X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Ffx2lafw%2Ffx2lafw.c;h=e74312fb77b8a745d770bd007f7fafed4c7e03d6;hb=886a52b6fbffb0fd06849c928cf9fd31a0d4657b;hp=9a1932701f587c807001d6f0b6dff046ac2c0973;hpb=6f22a8ef2ccf7091324b41b553632695507215a7;p=libsigrok.git diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 9a193270..e74312fb 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -406,7 +406,7 @@ static int hw_init(void) if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) { sr_err("fx2lafw: driver context malloc failed."); - return SR_ERR; + return SR_ERR_MALLOC; } if (libusb_init(NULL) != 0) { @@ -972,8 +972,10 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, const size_t size = get_buffer_size(devc); devc->transfers = g_try_malloc0(sizeof(*devc->transfers) * num_transfers); - if (!devc->transfers) - return SR_ERR; + if (!devc->transfers) { + sr_err("fx2lafw: USB transfers malloc failed."); + return SR_ERR_MALLOC; + } devc->num_transfers = num_transfers;