From: Bert Vermeulen Date: Fri, 2 Nov 2012 19:43:49 +0000 (+0100) Subject: colead-slm: fix sloppy driver context handling X-Git-Tag: dsupstream~590 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=538ac9a91e5efb65e3c28d5a9af16c6fcfd63872;p=libsigrok.git colead-slm: fix sloppy driver context handling --- diff --git a/hardware/colead-slm/api.c b/hardware/colead-slm/api.c index 2330ad66..a22ccff5 100644 --- a/hardware/colead-slm/api.c +++ b/hardware/colead-slm/api.c @@ -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;