From: Uwe Hermann Date: Wed, 29 Aug 2018 22:52:19 +0000 (+0200) Subject: ipdbg-la: Drop unneeded g_malloc0() checks for small allocations. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fac36d0a7714b3e052f2eddbc1baecdaa47fc6ce;p=libsigrok.git ipdbg-la: Drop unneeded g_malloc0() checks for small allocations. --- diff --git a/src/hardware/ipdbg-la/api.c b/src/hardware/ipdbg-la/api.c index 6a8f261b..59996093 100644 --- a/src/hardware/ipdbg-la/api.c +++ b/src/hardware/ipdbg-la/api.c @@ -97,11 +97,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) return NULL; struct sr_dev_inst *sdi = g_malloc0(sizeof(struct sr_dev_inst)); - if (!sdi) { - sr_err("no possible to allocate sr_dev_inst"); - return NULL; - } - sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("ipdbg.org"); sdi->model = g_strdup("IPDBG LA"); diff --git a/src/hardware/ipdbg-la/protocol.c b/src/hardware/ipdbg-la/protocol.c index c9fc45a4..d02ec737 100644 --- a/src/hardware/ipdbg-la/protocol.c +++ b/src/hardware/ipdbg-la/protocol.c @@ -89,7 +89,6 @@ SR_PRIV struct ipdbg_la_tcp *ipdbg_la_tcp_new(void) struct ipdbg_la_tcp *tcp; tcp = g_malloc0(sizeof(struct ipdbg_la_tcp)); - tcp->address = NULL; tcp->port = NULL; tcp->socket = -1; @@ -308,7 +307,7 @@ SR_PRIV int ipdbg_la_receive_data(int fd, int revents, void *cb_data) devc->raw_sample_buf = g_try_malloc(devc->limit_samples * devc->DATA_WIDTH_BYTES); if (!devc->raw_sample_buf) { - sr_warn("Sample buffer malloc failed."); + sr_err("Sample buffer malloc failed."); return FALSE; } }