drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc
authorJosé Expósito <jose.exposito89@gmail.com>
Sun, 9 Jan 2022 19:24:31 +0000 (20:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Feb 2022 16:27:13 +0000 (17:27 +0100)
commit8f069f6dde518dfebe86e848508c07e497bd9298
treea58816558fe01f183f4fdb016255d22a43d321fa
parent13bd31390cae1397c94dd7b97d8103bb5d587b9b
drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc

[ Upstream commit 170b22234d5495f5e0844246e23f004639ee89ba ]

The function performs a check on the "ctx" input parameter, however, it
is used before the check.

Initialize the "base" variable after the sanity check to avoid a
possible NULL pointer dereference.

Fixes: 4259ff7ae509e ("drm/msm/dpu: add support for pcc color block in dpu driver")
Addresses-Coverity-ID: 1493866 ("Null pointer dereference")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://lore.kernel.org/r/20220109192431.135949-1-jose.exposito89@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c