linux/drivers/media/common
Haotian Zhang 94de23a9aa media: videobuf2: Fix device reference leak in vb2_dc_alloc error path
In vb2_dc_alloc(), get_device() is called to increment the device
reference count. However, if subsequent DMA allocation fails
(vb2_dc_alloc_coherent or vb2_dc_alloc_non_coherent returns error),
the function returns without calling put_device(), causing a device
reference leak.

Add put_device() call in the error path before kfree() to properly
release the device reference acquired earlier.

Fixes: de27891f67 ("media: videobuf2: handle non-contiguous DMA allocations")
Cc: stable@vger.kernel.org
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
History 2025-11-03 15:58:42 +01:00
..
b2c2 media: b2c2: Remove space before newline 2025-08-29 11:04:02 +02:00
saa7146 media: saa7146: Replace saa7146_ext_vv.vbi_fops with write function 2025-11-03 15:58:42 +01:00
siano media: siano: Fix error handling in smsdvb_module_init() 2025-03-06 17:28:29 +01:00
v4l2-tpg media: v4l2-tpg: use (t,l)/wxh format for rectangle 2025-03-05 10:43:27 +01:00
videobuf2 media: videobuf2: Fix device reference leak in vb2_dc_alloc error path 2025-11-03 15:58:42 +01:00
cx2341x.c media: update Hans Verkuil's email address 2025-09-09 15:59:02 +02:00
cypress_firmware.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
cypress_firmware.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig media updates for v6.3-rc1 2023-02-26 11:47:26 -08:00
Makefile media updates for v6.3-rc1 2023-02-26 11:47:26 -08:00
ttpci-eeprom.c media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
ttpci-eeprom.h media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
tveeprom.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
uvc.c media: uvcvideo: Add support for the D3DFMT_R5G6B5 pixmap type 2024-10-08 16:04:44 +02:00