]> sigrok.org Git - libsigrok.git/blobdiff - hardware/colead-slm/api.c
sr_driver_scan(): Improve checks.
[libsigrok.git] / hardware / colead-slm / api.c
index fd6112d86b80b6042e3cf8c2b7414daaa68a2f53..39e557a676ee2106fd9d232e82e6c154f0edcab7 100644 (file)
@@ -97,10 +97,11 @@ static GSList *hw_scan(GSList *options)
        GSList *devices, *l;
        const char *conn, *serialcomm;
 
-       devices = NULL;
        drvc = di->priv;
        drvc->instances = NULL;
 
+       devices = NULL;
+
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
@@ -123,7 +124,7 @@ static GSList *hw_scan(GSList *options)
                return NULL;
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
-               sr_dbg("failed to malloc devc");
+               sr_dbg("Device context malloc failed.");
                return NULL;
        }