drm/panel: check failure cases in the probe func
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Wed, 24 Jul 2019 19:55:34 +0000 (14:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 16:56:31 +0000 (18:56 +0200)
commitf3d62177dee3bff0e75d72f2326672707354199d
tree82d2a345ec3162e57fc1e44c58aab3e434647fa7
parent9cb3698dcc865314c8d126db6e119c754b6c627f
drm/panel: check failure cases in the probe func

[ Upstream commit afd6d4f5a52c16e1483328ac074abb1cde92c29f ]

The following function calls may fail and return NULL, so the null check
is added.
of_graph_get_next_endpoint
of_graph_get_remote_port_parent
of_graph_get_remote_port

Update: Thanks to Sam Ravnborg, for suggession on the use of goto to avoid
leaking endpoint.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190724195534.9303-1-navid.emamdoost@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c