From: Bert Vermeulen Date: Mon, 8 Sep 2014 21:30:21 +0000 (+0200) Subject: scpi-pps: Fix config_set checks. X-Git-Tag: libsigrok-0.4.0~1019 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fdedbfcdef0b0d0b36855df3f118efb219048368;p=libsigrok.git scpi-pps: Fix config_set checks. --- diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index 9ca71d3d..5b64f4b6 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -331,6 +331,9 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, int ret; const char *s; + if (!sdi) + return SR_ERR_ARG; + if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -359,10 +362,6 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } } else { /* Channel group specified. */ - if (!sdi) - return SR_ERR_ARG; - if (g_slist_length(cg->channels) > 1) - return SR_ERR_NA; ch = cg->channels->data; pch = ch->priv; switch (key) {