]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: Fix null pointer dereference on pointer edp
authorColin Ian King <colin.king@canonical.com>
Wed, 29 Sep 2021 12:18:57 +0000 (13:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:17 +0000 (11:40 +0200)
commit6299788ff8420d93e24023b919d94b7b2c2376ce
tree3742eecf5c3089991fb6d0dfef544eeb72a8d2e2
parentef08f448f98e61038865355f0465ccc7b28c1ca8
drm/msm: Fix null pointer dereference on pointer edp

commit 2133c4fc8e1348dcb752f267a143fe2254613b34 upstream.

The initialization of pointer dev dereferences pointer edp before
edp is null checked, so there is a potential null pointer deference
issue. Fix this by only dereferencing edp after edp has been null
checked.

Addresses-Coverity: ("Dereference before null check")
Fixes: 777b6cb95893 ("drm/msm: Initial add eDP support in msm drm driver (v5)")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210929121857.213922-1-colin.king@canonical.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/edp/edp_ctrl.c