X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi.c;h=c3c2f7130e5c14d00a0eef3ed0af90be5bd89d50;hb=be64f90b53d09d9720dc6e06ff8ab61d96c03932;hp=0efde8bab7b9c11f8d2cec00ee48f1afd0ecac4f;hpb=e57057aee778e723da572a6b5e2bd01526cc7beb;p=libsigrok.git diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index 0efde8ba..c3c2f713 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -110,12 +110,16 @@ static struct sr_dev_inst *sr_scpi_scan_resource(struct drv_context *drvc, return NULL; }; - if ((sdi = probe_device(scpi))) - return sdi; + sdi = probe_device(scpi); sr_scpi_close(scpi); - sr_scpi_free(scpi); - return NULL; + + if (sdi) + sdi->status = SR_ST_INACTIVE; + else + sr_scpi_free(scpi); + + return sdi; } SR_PRIV GSList *sr_scpi_scan(struct drv_context *drvc, GSList *options,