]> sigrok.org Git - libsigrok.git/commitdiff
scpi: Don't return NULL device from unsuccessful scan.
authorBert Vermeulen <redacted>
Tue, 9 Sep 2014 17:53:55 +0000 (19:53 +0200)
committerBert Vermeulen <redacted>
Tue, 9 Sep 2014 17:53:55 +0000 (19:53 +0200)
src/scpi/scpi.c

index 38e322f5ffb7190e9998d81fa69c7e0ef80f441c..8d46d849b0748ae7f4c76bc6499ba40c1c419cec 100644 (file)
@@ -157,7 +157,8 @@ SR_PRIV GSList *sr_scpi_scan(struct drv_context *drvc, GSList *options,
 
        if (!devices && resource) {
                sdi = sr_scpi_scan_resource(drvc, resource, serialcomm, probe_device);
-               devices = g_slist_append(NULL, sdi);
+               if (sdi)
+                       devices = g_slist_append(NULL, sdi);
        }
 
        /* Tack a copy of the newly found devices onto the driver list. */