From: Rob Clark Date: Sun, 11 Dec 2011 20:02:27 +0000 (-0600) Subject: OMAPDSS: fix potential NULL pointer ref in OCP_ERR handling path X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=00f17e4560da32db454c46faf1e8df4fe35cc226;p=linux-beck.git OMAPDSS: fix potential NULL pointer ref in OCP_ERR handling path The dispc's error handler tries to disable all outputs when OCP_ERR happens. However, the code doesn't check if there actually is a display on each particular output, nor if there's a driver for the display. This may lead to NULL pointer reference. Signed-off-by: Rob Clark [tomi.valkeinen@ti.com: added patch description] Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 0f84034928ad..4d684282b201 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -3201,7 +3201,8 @@ static void dispc_error_worker(struct work_struct *work) for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) { struct omap_overlay_manager *mgr; mgr = omap_dss_get_overlay_manager(i); - mgr->device->driver->disable(mgr->device); + if (mgr->device && mgr->device->driver) + mgr->device->driver->disable(mgr->device); } }