]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: dm1105: fix missing error check for dma_alloc_coherent
authorZhaoyang Yu <2426767509@qq.com>
Wed, 15 Apr 2026 14:49:09 +0000 (14:49 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 5 May 2026 14:57:02 +0000 (16:57 +0200)
commit3eaac9e02d8591d3c790db572ef1c8fa5a841fdb
tree076c27862f967f8c3f690fc323e2939032be107c
parente42469304440d6b351b34eddb9284f198ceaf969
media: dm1105: fix missing error check for dma_alloc_coherent

The return value of dm1105_dma_map(), which handles DMA memory allocation,
is ignored in dm1105_hw_init(). If dma_alloc_coherent() fails, the driver
will proceed using a NULL pointer for DMA transfers, leading to a kernel
oops or invalid hardware access.

Fix this by checking the return value and propagating -ENOMEM on failure.

Signed-off-by: Zhaoyang Yu <2426767509@qq.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/pci/dm1105/dm1105.c