This cleans up a warning generated by clang's static analyzer.
*devices = g_slist_append(*devices, sdi);
drvc->instances = g_slist_append(drvc->instances, sdi);
- return SR_OK;
+ if (ret == SR_OK)
+ return SR_OK;
err_free_dev_inst:
sr_dev_inst_free(sdi);
struct dev_context *devc;
int ret;
- ret = SR_ERR;
-
if (!(devc = sdi->priv))
return SR_ERR_BUG;
sdi->status = SR_ST_ACTIVE;
- return SR_OK;
+ if (ret == SR_OK)
+ return SR_OK;
err_ftdi_free:
ftdi_free(devc->ftdic); /* Close device (if open), free FTDI context. */