From: Bert Vermeulen Date: Fri, 2 Nov 2012 23:41:21 +0000 (+0100) Subject: don't assume the driver has been initialized when cleaning up. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=81fbb7e14292c332ba7e2e617c2c50a132189820;p=sigrok-util.git don't assume the driver has been initialized when cleaning up. clear_instances() can get called on an unused driver. --- diff --git a/source/drv-api.c b/source/drv-api.c index 3d71daa..1288a7f 100644 --- a/source/drv-api.c +++ b/source/drv-api.c @@ -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;