]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/msm/a6xx: move preempt_prepare_postamble after error check
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Thu, 13 Nov 2025 08:28:31 +0000 (00:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:04 +0000 (12:57 +0100)
commit2c46497eb148ec61909f4101b8443f3c4c2daaec
tree2d16451489842e44a1a224f0a2c45d5ae4e03fc9
parent19648135e904bce447d368ecb6136e5da809639c
drm/msm/a6xx: move preempt_prepare_postamble after error check

[ Upstream commit ef3b04091fd8bc737dc45312375df8625b8318e2 ]

Move the call to preempt_prepare_postamble() after verifying that
preempt_postamble_ptr is valid. If preempt_postamble_ptr is NULL,
dereferencing it in preempt_prepare_postamble() would lead to a crash.

This change avoids calling the preparation function when the
postamble allocation has failed, preventing potential NULL pointer
dereference and ensuring proper error handling.

Fixes: 50117cad0c50 ("drm/msm/a6xx: Use posamble to reset counters on preemption")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Patchwork: https://patchwork.freedesktop.org/patch/687659/
Message-ID: <20251113082839.3821867-1-alok.a.tiwari@oracle.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/adreno/a6xx_preempt.c