linux/drivers/media
José Expósito f0f078457f media: uvcvideo: Fix memory leak in uvc_gpio_parse
Previously the unit buffer was allocated before checking the IRQ for
privacy GPIO. In case of error, the unit buffer was leaked.

Allocate the unit buffer after the IRQ to avoid it.

Addresses-Coverity-ID: 1474639 ("Resource leak")

Fixes: 2886477ff9 ("media: uvcvideo: Implement UVC_EXT_GPIO_UNIT")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-08-30 16:04:19 +02:00
..
cec media: media/cec: use CEC_MAX_MSG_SIZE instead of hardcoded 16 2022-08-30 07:37:02 +02:00
common media: videobuf2: Remove vb2_find_timestamp() 2022-08-30 14:44:45 +02:00
dvb-core media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
dvb-frontends media: avoid use of 'videobuf' 2022-08-29 16:27:18 +02:00
firewire media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00
i2c media: tc358743: limit msg.len to CEC_MAX_MSG_SIZE 2022-08-30 07:37:24 +02:00
mc media: mc-entity: Add a new helper function to get a remote pad for a pad 2022-07-17 11:23:51 +01:00
mmc media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
pci media: cx23885: reset DMA on AMD Renior/Cezanne IOMMU due to RiSC engine stall 2022-08-30 07:35:21 +02:00
platform media: renesas: vsp1: Add support for RZ/G2L VSPD 2022-08-30 15:34:10 +02:00
radio media: make RADIO_ADAPTERS tristate 2022-05-13 11:02:19 +02:00
rc media: lirc: ensure lirc device receives repeats 2022-07-15 14:55:23 +01:00
spi media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
test-drivers media: avoid use of 'videobuf' 2022-08-29 16:27:18 +02:00
tuners media: si2157: unknown chip version Si2147-A30 ROM 0x50 2022-04-09 17:45:49 +02:00
usb media: uvcvideo: Fix memory leak in uvc_gpio_parse 2022-08-30 16:04:19 +02:00
v4l2-core media: media/v4l2-mem2mem.h: rename 'videobuf' to 'vb2' 2022-08-29 15:47:03 +02:00
Kconfig media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00