X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fnorma-dmm%2Fapi.c;h=34d7de145e58af9a7804c993b819fb8b3f13e583;hb=c368e6f3d248a73d69cd0c2c4a7c88a92def55e3;hp=2f56441af5f11da231141051bc75be152f7db17d;hpb=aac29cc192ccf82b64e77b5e6b11b411da32deed;p=libsigrok.git diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c index 2f56441a..34d7de14 100644 --- a/src/hardware/norma-dmm/api.c +++ b/src/hardware/norma-dmm/api.c @@ -149,20 +149,14 @@ static GSList *do_scan(struct sr_dev_driver* drv, GSList *options) sdi->vendor = g_strdup(get_brandstr(drv)); sdi->model = g_strdup(get_typestr(auxtype, drv)); sdi->version = g_strdup(buf + 9); - if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { - sr_err("Device context malloc failed."); - return NULL; - } + devc = g_malloc0(sizeof(struct dev_context)); devc->type = auxtype; devc->version = g_strdup(&buf[9]); devc->elapsed_msec = g_timer_new(); - sdi->conn = serial; sdi->priv = devc; sdi->driver = drv; - if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, - "P1"))) - return NULL; + ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1"); sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi);