Pavel Sakharov 0336995512 dma-buf: Fix NULL pointer dereference in sanitycheck()
[ Upstream commit 2295bd846765c766701e666ed2e4b35396be25e6 ]

If due to a memory allocation failure mock_chain() returns NULL, it is
passed to dma_fence_enable_sw_signaling() resulting in NULL pointer
dereference there.

Call dma_fence_enable_sw_signaling() only if mock_chain() succeeds.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: d62c43a953ce ("dma-buf: Enable signaling on fence for selftests")
Signed-off-by: Pavel Sakharov <p.sakharov@ispras.ru>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240319231527.1821372-1-p.sakharov@ispras.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:28:21 +02:00
..
2024-04-03 15:19:32 +02:00
2024-04-03 15:19:42 +02:00
2024-02-05 20:12:47 +00:00
2024-04-03 15:19:45 +02:00
2024-04-03 15:19:46 +02:00
2024-01-20 11:50:10 +01:00
2024-03-26 18:21:00 -04:00