Skip to contentSkip to conversation

media: uvcvideo: Fix memory leak of uvc resources

PATCH Superseded Jeffy Chen 1 participant 1 message Oct 9, 2017

Subsystems (2)
lore
Share & tools
lore

Jeffy Chen

author
#0 lore raw

PATCH 1/1 media: uvcvideo: Fix memory leak of uvc resources

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")

---

 drivers/media/usb/uvc/uvc_driver.c | 1 -
 1 file changed, 1 deletion(-)
drivers/media/usb/uvc/uvc_driver.c +0 -1
index 6d22b22cb35b..dd6106411eb0 100644
@@ -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;
 }
 
Signature · 1 line
2.11.0