hantek-6xxx: sdi might be NULL - don't assign devc until !sdi is checked.

This commit is contained in:
Sebastian Zagrodzki 2016-08-19 15:22:35 +02:00 committed by Uwe Hermann
parent 0d8a3063e3
commit 7f46b27ef2
1 changed files with 2 additions and 2 deletions

View File

@ -467,8 +467,6 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
GVariant *gvar;
struct dev_context *devc;
devc = sdi->priv;
if (key == SR_CONF_SCAN_OPTIONS) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
@ -482,6 +480,8 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
if (!sdi)
return SR_ERR_ARG;
devc = sdi->priv;
if (!cg) {
switch (key) {
case SR_CONF_DEVICE_OPTIONS: