From: Daniel Morsing Date: Wed, 3 Aug 2011 20:10:51 +0000 (+0200) Subject: OMAP: DSS2: Don't allow moving managers away from enabled displays X-Git-Tag: next-20110916~34^2~80 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0f770b4765846846cc531f6828fb8402f92e2649;p=karo-tx-linux.git OMAP: DSS2: Don't allow moving managers away from enabled displays If a manager is moved while attached to an enabled display, the DSS system will be left in an inconsistent state. This will eventually cause a kernel oops when the enabled display is disabled. Fix this by not allowing the user to move a manager away from an enabled display. Signed-off-by: Daniel Morsing Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 13d72d5c714b..63674b054d35 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c @@ -586,6 +586,13 @@ static int omap_dss_unset_device(struct omap_overlay_manager *mgr) return -EINVAL; } + /* + * Don't allow currently enabled displays to have the overlay manager + * pulled out from underneath them + */ + if (mgr->device->state != OMAP_DSS_DISPLAY_DISABLED) + return -EINVAL; + mgr->device->manager = NULL; mgr->device = NULL; mgr->device_changed = true;