From: Shuah Khan Date: Tue, 29 Mar 2016 00:25:29 +0000 (-0300) Subject: [media] media: au0828 fix au0828_v4l2_device_register() to not unlock and free X-Git-Tag: v4.7~34^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eda220acd5f2cef789430110f66a74cb49309b68;p=platform%2Fkernel%2Flinux-exynos.git [media] media: au0828 fix au0828_v4l2_device_register() to not unlock and free au0828_v4l2_device_register() unlocks au0828_dev->lock and frees au0828 dev in error legs before return. au0828_usb_probe() does the same when au0828_v4l2_device_register() returns error. Fix au0828_v4l2_device_register() to not to unlock and free in its error legs. Signed-off-by: Shuah Khan Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 32d7db9..7d0ec4c 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -679,8 +679,6 @@ int au0828_v4l2_device_register(struct usb_interface *interface, if (retval) { pr_err("%s() v4l2_device_register failed\n", __func__); - mutex_unlock(&dev->lock); - kfree(dev); return retval; } @@ -691,8 +689,6 @@ int au0828_v4l2_device_register(struct usb_interface *interface, if (retval) { pr_err("%s() v4l2_ctrl_handler_init failed\n", __func__); - mutex_unlock(&dev->lock); - kfree(dev); return retval; } dev->v4l2_dev.ctrl_handler = &dev->v4l2_ctrl_hdl;