]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Don't close SCPI handle we didn't open.
authorBert Vermeulen <redacted>
Thu, 27 Mar 2014 14:13:24 +0000 (15:13 +0100)
committerBert Vermeulen <redacted>
Thu, 27 Mar 2014 14:13:24 +0000 (15:13 +0100)
hardware/rigol-ds/api.c

index b8dbe89fdb28e8ff0f8729d2a0bdb64638723dcb..4d49be0b5da9c64a6cf1f484cd47f35e05096207 100644 (file)
@@ -273,8 +273,6 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
 
        if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
                sr_info("Couldn't get IDN response.");
-               sr_scpi_close(scpi);
-               sr_scpi_free(scpi);
                return NULL;
        }
 
@@ -292,13 +290,9 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
                                                  model->name,
                                                  hw_info->firmware_version))) {
                sr_scpi_hw_info_free(hw_info);
-               sr_scpi_close(scpi);
-               sr_scpi_free(scpi);
                return NULL;
        }
 
-       sr_scpi_close(scpi);
-
        sdi->conn = scpi;
 
        sdi->driver = di;