From: Uwe Hermann Date: Fri, 22 Nov 2013 19:03:03 +0000 (+0100) Subject: hantek-dso: config_list(): Only SR_CONF_BUFFERSIZE needs sdi. X-Git-Tag: libsigrok-0.3.0~537 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a147c7b416c51d115708dce56f096cf1fe8bfb06;p=libsigrok.git hantek-dso: config_list(): Only SR_CONF_BUFFERSIZE needs sdi. --- diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index 5d09e80a..f74cefdf 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -595,10 +595,6 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, (void)probe_group; - if (!sdi) - return SR_ERR_ARG; - - devc = sdi->priv; switch (key) { case SR_CONF_SCAN_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, @@ -609,6 +605,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, devopts, ARRAY_SIZE(devopts), sizeof(int32_t)); break; case SR_CONF_BUFFERSIZE: + if (!sdi) + return SR_ERR_ARG; + devc = sdi->priv; *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT64, devc->profile->buffersizes, 2, sizeof(uint64_t)); break;