drm/msm: Fix potential NULL dereference in DPU SSPP
authorJessica Zhang <jesszhan@codeaurora.org>
Wed, 20 Oct 2021 17:57:33 +0000 (10:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:10 +0000 (14:04 +0100)
commit807f01f60cd0a9b0c3154d7b635b02b8002d3c9f
tree8bb9ea10393abcef9488f467e0bdde52e120161b
parent6d1f3157aa9b52fecb259916925ae164ebfa7ccb
drm/msm: Fix potential NULL dereference in DPU SSPP

[ Upstream commit 8bf71a5719b6cc5b6ba358096081e5d50ea23ab6 ]

Move initialization of sblk in _sspp_subblk_offset() after NULL check to
avoid potential NULL pointer dereference.

Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jessica Zhang <jesszhan@codeaurora.org>
Link: https://lore.kernel.org/r/20211020175733.3379-1-jesszhan@codeaurora.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c