]> sigrok.org Git - sigrok-util.git/commitdiff
don't assume the driver has been initialized when cleaning up.
authorBert Vermeulen <redacted>
Fri, 2 Nov 2012 23:41:21 +0000 (00:41 +0100)
committerBert Vermeulen <redacted>
Fri, 2 Nov 2012 23:41:21 +0000 (00:41 +0100)
clear_instances() can get called on an unused driver.

source/drv-api.c

index 3d71daa08fd211d271d1c49e8203882ed380aa62..1288a7fd58b53305ca5746c9fa208d51fde8c7b1 100644 (file)
@@ -33,7 +33,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;