From: Aurelien Jacobs Date: Sun, 2 Feb 2014 21:09:01 +0000 (+0100) Subject: rigol-ds: properly deal with dev_close() getting called multiple times X-Git-Tag: libsigrok-0.3.0~161 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=83dbd9f09caa400b09fdb699a34f728f1a33b58a;p=libsigrok.git rigol-ds: properly deal with dev_close() getting called multiple times --- diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c index f61d58ca..ae14f067 100644 --- a/hardware/rigol-ds/api.c +++ b/hardware/rigol-ds/api.c @@ -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;