]> sigrok.org Git - libsigrok.git/commitdiff
chronovu-la8: Code cleanup.
authorBert Vermeulen <redacted>
Thu, 2 Oct 2014 12:58:57 +0000 (14:58 +0200)
committerBert Vermeulen <redacted>
Thu, 2 Oct 2014 12:58:57 +0000 (14:58 +0200)
This cleans up a warning generated by clang's static analyzer.

src/hardware/chronovu-la/api.c

index 594a064919634cca8b524ec618b2f5a8e4944815..d65dabb6661b731efa703c4047ea8f7452eddb41 100644 (file)
@@ -142,7 +142,8 @@ static int add_device(int idx, int model, GSList **devices)
        *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);
@@ -210,8 +211,6 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct dev_context *devc;
        int ret;
 
-       ret = SR_ERR;
-
        if (!(devc = sdi->priv))
                return SR_ERR_BUG;
 
@@ -254,7 +253,8 @@ static int dev_open(struct sr_dev_inst *sdi)
 
        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. */