All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rpi_touchscreen_probe: check for failure case
@ 2019-07-24  2:56 Navid Emamdoost
  2019-07-24  5:17 ` Sam Ravnborg
  0 siblings, 1 reply; 7+ messages in thread
From: Navid Emamdoost @ 2019-07-24  2:56 UTC (permalink / raw)
  To: emamd001
  Cc: kjlu, smccaman, Navid Emamdoost, Thierry Reding, Sam Ravnborg,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel

of_graph_get_next_endpoint may return NULL, so null check is needed.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index 28c0620dfe0f..2e0977e26fab 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -399,6 +399,8 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c,
 
 	/* Look up the DSI host.  It needs to probe before we do. */
 	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	if (!endpoint)
+		return -ENODEV;
 	dsi_host_node = of_graph_get_remote_port_parent(endpoint);
 	host = of_find_mipi_dsi_host_by_node(dsi_host_node);
 	of_node_put(dsi_host_node);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-26 12:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-24  2:56 [PATCH] rpi_touchscreen_probe: check for failure case Navid Emamdoost
2019-07-24  5:17 ` Sam Ravnborg
2019-07-24 14:48   ` [PATCH] drm/panel: check failure cases in the probe func Navid Emamdoost
2019-07-24 18:59     ` Sam Ravnborg
2019-07-24 18:59       ` Sam Ravnborg
2019-07-24 19:55       ` [PATCH v2] " Navid Emamdoost
2019-07-26 12:33         ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.