Deal with uninitialized drivers

This commit is contained in:
Bert Vermeulen 2013-05-01 14:54:44 +02:00
parent c2fa697afa
commit 3a277f3b2b
1 changed files with 4 additions and 1 deletions

5
std.c
View File

@ -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. */