From: Lars-Peter Clausen Date: Tue, 10 May 2016 12:03:02 +0000 (+0200) Subject: link-mso19: Drop unnecessary NULL check X-Git-Tag: libsigrok-0.5.0~374 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f1e93a951ec455ec5576ef17c0853b38be242b0b;p=libsigrok.git link-mso19: Drop unnecessary NULL check 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 --- diff --git a/src/hardware/link-mso19/api.c b/src/hardware/link-mso19/api.c index d95aaff6..fffe407e 100644 --- a/src/hardware/link-mso19/api.c +++ b/src/hardware/link-mso19/api.c @@ -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;