]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: properly deal with dev_close() getting called multiple times
authorAurelien Jacobs <redacted>
Sun, 2 Feb 2014 21:09:01 +0000 (22:09 +0100)
committerUwe Hermann <redacted>
Fri, 7 Feb 2014 17:53:04 +0000 (18:53 +0100)
hardware/rigol-ds/api.c

index f61d58ca1e01993ac656fe6eb34fc6c5a3bb2fc2..ae14f067d3d1e2d2284009be4bdc3ba581573241 100644 (file)
@@ -482,8 +482,8 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_scpi_dev_inst *scpi;
        struct dev_context *devc;
 
-       if (sdi->status != SR_ST_INACTIVE)
-               return SR_OK;
+       if (sdi->status != SR_ST_ACTIVE)
+               return SR_ERR_DEV_CLOSED;
 
        scpi = sdi->conn;
        devc = sdi->priv;