From: Hans Verkuil Date: Mon, 20 Jul 2015 12:59:30 +0000 (-0300) Subject: [media] usbvision: return valid error in usbvision_register_video() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=2b43665ffbca7fe38617442cf731332afc94ead2;p=openwrt%2Fstaging%2Fblogic.git [media] usbvision: return valid error in usbvision_register_video() Don't return -1, return a proper error code. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c index ea67c8c05bcd..82a65a495c24 100644 --- a/drivers/media/usb/usbvision/usbvision-video.c +++ b/drivers/media/usb/usbvision/usbvision-video.c @@ -1304,6 +1304,8 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision) /* register video4linux devices */ static int usbvision_register_video(struct usb_usbvision *usbvision) { + int res = -ENOMEM; + /* Video Device: */ usbvision_vdev_init(usbvision, &usbvision->vdev, &usbvision_video_template, "USBVision Video"); @@ -1330,7 +1332,7 @@ static int usbvision_register_video(struct usb_usbvision *usbvision) "USBVision[%d]: video_register_device() failed\n", usbvision->nr); usbvision_unregister_video(usbvision); - return -1; + return res; } /*