X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fzeroplus.c;h=a2d616f21f7f7713ce8a47e8cc250bcf8ee8b4f3;hb=b53738baf76219237e0a6629905981d7a1f2508e;hp=7ce5c61b2fb185aa91ac1a95665050d6e98bd750;hpb=50959ddcdc455c930397fbc9f85c3a745ff45fda;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 7ce5c61b..a2d616f2 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -518,9 +518,11 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) header.num_analog_probes = 0; sr_session_bus(session_device_id, &packet); - buf = g_malloc(PACKET_SIZE); - if (!buf) - return SR_ERR; + if (!(buf = g_try_malloc(PACKET_SIZE))) { + sr_err("zeroplus: %s: buf malloc failed", __func__); + return SR_ERR_MALLOC; + } + analyzer_read_start(sdi->usb->devhdl); /* Send the incoming transfer to the session bus. */ for (packet_num = 0; packet_num < (memory_size * 4 / PACKET_SIZE);