hantek-6xxx: sdi might be NULL - don't assign devc until !sdi is checked.
This commit is contained in:
parent
0d8a3063e3
commit
7f46b27ef2
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue