If it is out of memory, we should return -ENOMEM;
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
prm->rbuf = kzalloc(prm->max_psize * USB_XFERS, GFP_KERNEL);
if (!prm->rbuf) {
prm->max_psize = 0;
+ ret = -ENOMEM;
goto err_free_descs;
}
prm->rbuf = kzalloc(prm->max_psize * USB_XFERS, GFP_KERNEL);
if (!prm->rbuf) {
prm->max_psize = 0;
- goto err;
+ ret = -ENOMEM;
+ goto err_no_memory;
}
ret = alsa_uac2_init(agdev);
if (ret)
- goto err;
+ goto err_no_memory;
return 0;
-err:
+err_no_memory:
kfree(agdev->uac2.p_prm.rbuf);
kfree(agdev->uac2.c_prm.rbuf);
err_free_descs:
usb_free_all_descriptors(fn);
- return -EINVAL;
+ return ret;
}
static int