]> sigrok.org Git - libsigrok.git/commitdiff
colead-slm: fix sloppy driver context handling
authorBert Vermeulen <redacted>
Fri, 2 Nov 2012 19:43:49 +0000 (20:43 +0100)
committerBert Vermeulen <redacted>
Fri, 2 Nov 2012 19:44:34 +0000 (20:44 +0100)
hardware/colead-slm/api.c

index 2330ad66f805a29543d95e1ec53c6634039b4379..a22ccff5e874defaa1eafca0436fbc34d83d0c8c 100644 (file)
@@ -57,7 +57,9 @@ static int clear_instances(void)
        struct dev_context *devc;
        GSList *l;
 
-       drvc = di->priv;
+       if (!(drvc = di->priv))
+               return SR_OK;
+
        for (l = drvc->instances; l; l = l->next) {
                if (!(sdi = l->data))
                        continue;