]> sigrok.org Git - libsigrok.git/commitdiff
link-mso19: Drop unnecessary NULL check
authorLars-Peter Clausen <redacted>
Tue, 10 May 2016 12:03:02 +0000 (14:03 +0200)
committerLars-Peter Clausen <redacted>
Mon, 23 May 2016 16:24:23 +0000 (18:24 +0200)
sdi is allocated using g_malloc0() which can never fail, in addition to
that sdi is already dereferenced before the check, which makes the check
useless. So remove it.

Signed-off-by: Lars-Peter Clausen <redacted>
src/hardware/link-mso19/api.c

index d95aaff6f29e76d0f2f831f9dae5da3d841ab04a..fffe407eac6cbe0425c94cdddeb81370568d03f3 100644 (file)
@@ -192,15 +192,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                sdi->vendor = g_strdup(manufacturer);
                sdi->model = g_strdup(product);
                sdi->version = g_strdup(hwrev);
-
-               if (!sdi) {
-                       sr_err("Unable to create device instance for %s",
-                              sysname);
-                       sr_dev_inst_free(sdi);
-                       g_free(devc);
-                       return devices;
-               }
-
                sdi->driver = di;
                sdi->priv = devc;