From: Bert Vermeulen Date: Tue, 9 Sep 2014 17:53:55 +0000 (+0200) Subject: scpi: Don't return NULL device from unsuccessful scan. X-Git-Tag: libsigrok-0.4.0~1013 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=cfd8ec53abc53ad40a94cbb881776b58ed976d3a;p=libsigrok.git scpi: Don't return NULL device from unsuccessful scan. --- diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index 38e322f5..8d46d849 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -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. */