Skip to content
Commit b097efba authored by Colin Ian King's avatar Colin Ian King Committed by Vinod Koul
Browse files

drm/mediatek: avoid dereferencing a null hdmi_phy on an error message



Currently there is a null pointer check for hdmi_phy that implies it
may be null, however a dev_err messages dereferences this potential null
pointer.  Avoid a null pointer dereference by only emitting the dev_err
message if hdmi_phy is non-null.  It is a moot point if the error message
needs to be printed at all, but since this is a relatively new piece of
code it may be useful to keep the message in for the moment in case there
are unforseen errors that need to be reported.

Fixes: be28b650 ("drm/mediatek: separate hdmi phy to different file")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Dereference after null check")
Link: https://lore.kernel.org/r/20201207150937.170435-1-colin.king@canonical.com


[vkoul: fix indent of return call]
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 1dfd7b78
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment