]> sigrok.org Git - libsigrok.git/blobdiff - hardware/fx2lafw/fx2lafw.c
Enforce open device before config_set()/dev_acquisition_start()
[libsigrok.git] / hardware / fx2lafw / fx2lafw.c
index f74c5a510b0f1fe4d6035ba37e3708c746820cd7..dbec30b754904e84244135a3bfb1a73e276501cd 100644 (file)
@@ -617,6 +617,9 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
        int ret;
 
+       if (sdi->status != SR_ST_ACTIVE)
+               return SR_ERR;
+
        devc = sdi->priv;
 
        if (id == SR_CONF_SAMPLERATE) {
@@ -948,6 +951,9 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        unsigned char *buf;
        size_t size;
 
+       if (sdi->status != SR_ST_ACTIVE)
+               return SR_ERR_DEV_CLOSED;
+
        drvc = di->priv;
        devc = sdi->priv;
        usb = sdi->conn;