diff mbox series

media: uvc_v4l2: fix possible memory leak in uvc_ioctl_ctrl_map

Message ID 20220324081718.41091-1-hbh25y@gmail.com
State New
Headers show
Series media: uvc_v4l2: fix possible memory leak in uvc_ioctl_ctrl_map | expand

Commit Message

Hangyu Hua March 24, 2022, 8:17 a.m. UTC
map->name needs to be freed when uvc_ioctl_ctrl_map fails.

Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
 drivers/media/usb/uvc/uvc_v4l2.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 711556d13d03..e46a2f3b06cb 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -93,6 +93,7 @@  static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
 
 	kfree(map->menu_info);
 free_map:
+	kfree(map->name);
 	kfree(map);
 
 	return ret;