]> sigrok.org Git - libsigrok.git/blobdiff - hardware/colead-slm/api.c
colead-slm: fix sloppy driver context handling
[libsigrok.git] / 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;