]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 25 Jan 2022 02:45:39 +0000 (05:45 +0300)
commit0ad48b51d511819a5dd1327f37b8403dfccf6332
tree9cb397449e31b28a2e386ac1abb26aa9f56c521c
parent8075e02030abf4e325df3dafe40693f4dd8180db
drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc

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: 8ea1ad782ba1c ("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>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c