Skip to content

Commit

Permalink
OMAPDSS: fix potential NULL pointer ref in OCP_ERR handling path
Browse files Browse the repository at this point in the history
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 <rob@ti.com>
[tomi.valkeinen@ti.com: added patch description]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Rob Clark authored and Tomi Valkeinen committed Jan 2, 2012
1 parent f806f9b commit 00f17e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 00f17e4

Please sign in to comment.