]> sigrok.org Git - libsigrok.git/commitdiff
scpi-pps: Fix config_set checks.
authorBert Vermeulen <redacted>
Mon, 8 Sep 2014 21:30:21 +0000 (23:30 +0200)
committerBert Vermeulen <redacted>
Mon, 8 Sep 2014 21:30:21 +0000 (23:30 +0200)
src/hardware/scpi-pps/api.c

index 9ca71d3d01872f4d5103ac512e44cc3908273511..5b64f4b622e9b4a5f788b14a00f03f61e56bc620 100644 (file)
@@ -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) {