diff options
author | Subramaniam Chanderashekarapuram | 2014-09-17 18:40:58 -0500 |
---|---|---|
committer | Subramaniam Chanderashekarapuram | 2014-09-17 18:57:34 -0500 |
commit | 6186c4779854d62a6c74a25147c231ae5f6d7a47 (patch) | |
tree | f5f07735929f09aa8480b5cc4d04719dbef6a3f5 | |
parent | f63073dbb6c8ffc2faae6e543888af0675a02cef (diff) | |
download | kernel-audio-6186c4779854d62a6c74a25147c231ae5f6d7a47.tar.gz kernel-audio-6186c4779854d62a6c74a25147c231ae5f6d7a47.tar.xz kernel-audio-6186c4779854d62a6c74a25147c231ae5f6d7a47.zip |
OMAPFB: fix kernel panic when no panels are connected
In case the device configuration is such that there is no display
attached to it, the free_resources as part of cleanup tries to free
a non-existent dssdev. This causes a kernel panic. Adding proper checks
fixes it.
Change-Id: Ifb4fe234a71c4ef8200a2f67211428780f2aebee
Signed-off-by: Subramaniam Chanderashekarapuram <c.a.subramaniam@gmail.com>
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index ca585ef37f25..1b015f26e0cc 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -1866,10 +1866,13 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev) | |||
1866 | if (fbdev->displays[i].auto_update_work_enabled) | 1866 | if (fbdev->displays[i].auto_update_work_enabled) |
1867 | omapfb_stop_auto_update(fbdev, dssdev); | 1867 | omapfb_stop_auto_update(fbdev, dssdev); |
1868 | 1868 | ||
1869 | if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) | 1869 | if (dssdev) { |
1870 | dssdev->driver->disable(dssdev); | 1870 | if (dssdev->driver && dssdev->driver->disable |
1871 | && dssdev->state != OMAP_DSS_DISPLAY_DISABLED) | ||
1872 | dssdev->driver->disable(dssdev); | ||
1871 | 1873 | ||
1872 | omap_dss_put_device(dssdev); | 1874 | omap_dss_put_device(dssdev); |
1875 | } | ||
1873 | } | 1876 | } |
1874 | 1877 | ||
1875 | if (fbdev->auto_update_wq != NULL) { | 1878 | if (fbdev->auto_update_wq != NULL) { |