diff options
| author | Haotian Zhang <vulab@iscas.ac.cn> | 2025-10-28 14:44:43 +0800 |
|---|---|---|
| committer | Hans Verkuil <hverkuil+cisco@kernel.org> | 2025-11-03 15:58:42 +0100 |
| commit | 94de23a9aa487d7c1372efb161721d7949a177ae (patch) | |
| tree | 8150cbbc4a478182654ea04e85519e4b1c7043e1 /drivers/media/platform/qcom/iris/iris_utils.c | |
| parent | ba92a96b1e95a67cb736d095dceb788207b90a7b (diff) | |
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: de27891f675e ("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>
Diffstat (limited to 'drivers/media/platform/qcom/iris/iris_utils.c')
0 files changed, 0 insertions, 0 deletions
