X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Funi-t-ut32x%2Fapi.c;h=aa38cf5fb7bd04bb11be8c00b39bdc1d00ce4456;hb=1f501d72ef58861e27c6c7fcbb26780ad41010ef;hp=95096c0b60d8e0c8c776ef8e79037c0afbd0f444;hpb=aac29cc192ccf82b64e77b5e6b11b411da32deed;p=libsigrok.git diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index 95096c0b..aa38cf5f 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -87,18 +87,11 @@ static GSList *scan(GSList *options) sdi->inst_type = SR_INST_USB; sdi->conn = l->data; for (i = 0; i < 3; i++) { - if (!(ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, - channels[i]))) { - sr_dbg("Channel malloc failed."); - return NULL; - } + ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, + channels[i]); sdi->channels = g_slist_append(sdi->channels, ch); } - - if (!(devc = g_try_malloc(sizeof(struct dev_context)))) { - sr_dbg("Device context malloc failed."); - return NULL; - } + devc = g_malloc0(sizeof(struct dev_context)); sdi->priv = devc; devc->limit_samples = 0; devc->data_source = DEFAULT_DATA_SOURCE;