]> sigrok.org Git - libsigrok.git/commitdiff
Deal with uninitialized drivers
authorBert Vermeulen <redacted>
Wed, 1 May 2013 12:54:44 +0000 (14:54 +0200)
committerBert Vermeulen <redacted>
Wed, 1 May 2013 21:30:37 +0000 (23:30 +0200)
std.c

diff --git a/std.c b/std.c
index 8add0d3dc622c2045cfa5c870efb4ab39183dde7..fe0893461ef2fe990c4556d3e4092a2969dd493a 100644 (file)
--- 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. */