linux-imx/drivers/media/usb/cx231xx
Zhipeng Lu 1e2c9e7418 media: cx231xx: fix a memleak in cx231xx_init_isoc
[ Upstream commit 5d3c8990e2 ]

The dma_q->p_left_data alloced by kzalloc should be freed in all the
following error handling paths. However, it hasn't been freed in the
allocation error paths of dev->video_mode.isoc_ctl.urb and
dev->video_mode.isoc_ctl.transfer_buffer.

On the other hand, the dma_q->p_left_data did be freed in the
error-handling paths after that of dev->video_mode.isoc_ctl.urb and
dev->video_mode.isoc_ctl.transfer_buffer, by calling
cx231xx_uninit_isoc(dev). So the same free operation should be done in
error-handling paths of those two allocation.

Fixes: 64fbf44455 ("[media] cx231xx: Added support for Carraera, Shelby, RDx_253S and VIDEO_GRABBER")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:34 -08:00
..
cx231xx-417.c
cx231xx-audio.c
cx231xx-avcore.c
cx231xx-cards.c
cx231xx-conf-reg.h
cx231xx-core.c
cx231xx-dif.h
cx231xx-dvb.c
cx231xx-i2c.c
cx231xx-input.c
cx231xx-pcb-cfg.c
cx231xx-pcb-cfg.h
cx231xx-reg.h
cx231xx-vbi.c
cx231xx-vbi.h
cx231xx-video.c
cx231xx.h
Kconfig
Makefile