summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-17 12:00:01 +0200
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-18 13:19:51 +0200
commitb3f91eb8d8d17ad3ca5da4fa9f20d2e46133fd99 (patch)
treedb3938ff5c9a7bf86ab4062ac9ddb4c009179b62
parentc121b15244c53637c3e9ca608b8816abcfbe2f8e (diff)
downloadlwn-b3f91eb8d8d17ad3ca5da4fa9f20d2e46133fd99.tar.gz
lwn-b3f91eb8d8d17ad3ca5da4fa9f20d2e46133fd99.zip
OMAP: DSS2: OMAPFB: fix dssdev cleanup on error
If there was a dss device without a driver and thus omapfb probe failed, ref counts could be left to dss devices. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index d17caef6915a..973bf7938086 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2111,18 +2111,23 @@ static int omapfb_probe(struct platform_device *pdev)
fbdev->dev = &pdev->dev;
platform_set_drvdata(pdev, fbdev);
+ r = 0;
fbdev->num_displays = 0;
dssdev = NULL;
for_each_dss_dev(dssdev) {
omap_dss_get_device(dssdev);
+
if (!dssdev->driver) {
dev_err(&pdev->dev, "no driver for display\n");
- r = -EINVAL;
- goto cleanup;
+ r = -ENODEV;
}
+
fbdev->displays[fbdev->num_displays++] = dssdev;
}
+ if (r)
+ goto cleanup;
+
if (fbdev->num_displays == 0) {
dev_err(&pdev->dev, "no displays\n");
r = -EINVAL;