From: Bert Vermeulen Date: Wed, 1 May 2013 12:54:44 +0000 (+0200) Subject: Deal with uninitialized drivers X-Git-Tag: dsupstream~11 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=3a277f3b2b01da3d7d1e26ddbb30471db68fc11c Deal with uninitialized drivers --- diff --git a/std.c b/std.c index 8add0d3d..fe089346 100644 --- a/std.c +++ b/std.c @@ -184,7 +184,10 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, GSList *l; int ret; - drvc = driver->priv; + if (!(drvc = driver->priv)) + /* Driver was never initialized, nothing to do. */ + return SR_OK; + ret = SR_OK; for (l = drvc->instances; l; l = l->next) { /* Log errors, but continue cleaning up the rest. */