Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
static void carlusb_free_driver(struct carlu *ar)
{
- if (ar) {
+ if (!IS_ERR_OR_NULL(ar)) {
if (ar->event_pipe[0] > -1)
close(ar->event_pipe[0]);
err_out:
carlusb_free_driver(tmp);
- return NULL;
+ return ERR_PTR(err);
}
static void carlusb_cancel_rings(struct carlu *ar)
int ret = -ENOMEM;
ar = carlusb_open();
- if (ar == NULL)
+ if (IS_ERR_OR_NULL(ar)) {
+ if (IS_ERR(ar))
+ ret = PTR_ERR(ar);
goto err_out;
+ }
ret = carlusb_show_devinfo(ar);
if (ret)
err_out:
carlusb_free_driver(ar);
err("usb device rendezvous failed (%d).\n", ret);
-
- return NULL;
+ return ERR_PTR(ret);
}
void carlusb_close(struct carlu *ar)