if (serial->fd < 0)
goto ret;
- if (!(buf = g_try_malloc(s))) {
- sr_err("Failed to malloc message buffer.");
- ret = SR_ERR_MALLOC;
- goto ret;
- }
+ buf = g_malloc(s);
p = buf;
memcpy(p, mso_head, sizeof(mso_head));
sr_dbg("Requesting trigger state.");
ret = mso_send_control_message(serial, ARRAY_AND_SIZE(ops));
- if (info == NULL || ret != SR_OK)
+ if (!info || ret != SR_OK)
return ret;
uint8_t buf = 0;