linux-stable/drivers/media/usb/uvc
Colin Ian King 4b06506055 media: uvcvideo: Fix memory leak of object map on error exit path
Currently when the allocation of map->name fails the error exit path
does not kfree the previously allocated object map. Fix this by
setting ret to -ENOMEM and taking the free_map exit error path to
ensure map is kfree'd.

Addresses-Coverity: ("Resource leak")

Fixes: 70fa906d6f ("media: uvcvideo: Use control names from framework")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-12-07 11:29:53 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile media: uvcvideo: Add a metadata device node 2018-01-04 06:41:47 -05:00
uvc_ctrl.c media: uvcvideo: Don't spam the log in uvc_ctrl_restore_values() 2021-09-30 10:07:48 +02:00
uvc_debugfs.c media: usb: uvc: no need to check return value of debugfs_create functions 2020-09-26 10:15:17 +02:00
uvc_driver.c media: uvcvideo: Set unique vdev name based in type 2021-09-30 10:07:47 +02:00
uvc_entity.c media: uvcvideo: Use dev_ printk aliases 2021-01-27 15:06:10 +01:00
uvc_isight.c media: uvcvideo: Rename debug functions 2021-01-27 15:08:19 +01:00
uvc_metadata.c media: uvcvideo: Use dev->name for querycap() 2021-09-30 10:07:47 +02:00
uvc_queue.c media: uvcvideo: Rename debug functions 2021-01-27 15:08:19 +01:00
uvc_status.c media: uvcvideo: Rename debug functions 2021-01-27 15:08:19 +01:00
uvc_v4l2.c media: uvcvideo: Fix memory leak of object map on error exit path 2021-12-07 11:29:53 +01:00
uvc_video.c media: uvcvideo: Return -EIO for control errors 2021-09-30 10:07:47 +02:00
uvcvideo.h media: uvcvideo: Set error_idx during ctrl_commit errors 2021-09-30 10:07:48 +02:00