* [PATCH] media: uvcvideo: Fix memory leak of uvc resources
@ 2017-10-09 3:40 Jeffy Chen
0 siblings, 0 replies; only message in thread
From: Jeffy Chen @ 2017-10-09 3:40 UTC (permalink / raw)
To: linux-kernel
Cc: Jeffy Chen, Mauro Carvalho Chehab, Laurent Pinchart, linux-media
The refcount would be inited to 1 in kref_init(), so we don't need to
increase it at the end of uvc_probe().
Fixes: 9d15cd958c17 ("media: uvcvideo: Convert from using an atomic variable to a reference count")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
drivers/media/usb/uvc/uvc_driver.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 6d22b22cb35b..dd6106411eb0 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1939,7 +1939,6 @@ static int uvc_register_video(struct uvc_device *dev,
else
stream->chain->caps |= V4L2_CAP_VIDEO_OUTPUT;
- kref_get(&dev->ref);
return 0;
}
--
2.11.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-09 3:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-09 3:40 [PATCH] media: uvcvideo: Fix memory leak of uvc resources Jeffy Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®