public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: uvc: don't put item still in use
@ 2022-09-29 14:41 Michael Grzeschik
  2022-09-30 11:58 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Grzeschik @ 2022-09-29 14:41 UTC (permalink / raw)
  To: linux-usb; +Cc: linux-media, balbi, laurent.pinchart, kernel

With the patch "15a286a0bb08 (usb: gadget: uvc: add v4l2 enumeration api
calls)" the driver is keeping a list of configfs entries currently
configured. The list is used in uvc_v4l2 on runtime.

The driver now is giving back the list item just after it was referenced
with config_item_put. It also calls config_item_put on uvc_free, which
is the only and right place to give back the reference. This patch fixes
the issue by removing the extra config_item_put in uvc_alloc.

Fixes: 15a286a0bb08 (usb: gadget: uvc: add v4l2 enumeration api calls)
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/usb/gadget/function/f_uvc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index e6948cf8def30b..8bc591431d153e 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -995,7 +995,6 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 		goto err_config;
 
 	uvc->header = to_uvcg_streaming_header(h);
-	config_item_put(h);
 	if (!uvc->header->linked) {
 		mutex_unlock(&opts->lock);
 		kfree(uvc);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-02 22:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-29 14:41 [PATCH] usb: gadget: uvc: don't put item still in use Michael Grzeschik
2022-09-30 11:58 ` Greg KH
2022-09-30 12:28   ` [PATCH v2] " Michael Grzeschik
2022-09-30 16:17     ` Laurent Pinchart
2022-09-30 20:44       ` Michael Grzeschik
2022-10-02 22:49         ` Michael Grzeschik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox