diff options
| author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-17 05:00:01 -0500 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-18 06:19:51 -0500 |
| commit | b3f91eb8d8d17ad3ca5da4fa9f20d2e46133fd99 (patch) | |
| tree | db3938ff5c9a7bf86ab4062ac9ddb4c009179b62 | |
| parent | c121b15244c53637c3e9ca608b8816abcfbe2f8e (diff) | |
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.c | 9 |
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) | |||
| 2111 | fbdev->dev = &pdev->dev; | 2111 | fbdev->dev = &pdev->dev; |
| 2112 | platform_set_drvdata(pdev, fbdev); | 2112 | platform_set_drvdata(pdev, fbdev); |
| 2113 | 2113 | ||
| 2114 | r = 0; | ||
| 2114 | fbdev->num_displays = 0; | 2115 | fbdev->num_displays = 0; |
| 2115 | dssdev = NULL; | 2116 | dssdev = NULL; |
| 2116 | for_each_dss_dev(dssdev) { | 2117 | for_each_dss_dev(dssdev) { |
| 2117 | omap_dss_get_device(dssdev); | 2118 | omap_dss_get_device(dssdev); |
| 2119 | |||
| 2118 | if (!dssdev->driver) { | 2120 | if (!dssdev->driver) { |
| 2119 | dev_err(&pdev->dev, "no driver for display\n"); | 2121 | dev_err(&pdev->dev, "no driver for display\n"); |
| 2120 | r = -EINVAL; | 2122 | r = -ENODEV; |
| 2121 | goto cleanup; | ||
| 2122 | } | 2123 | } |
| 2124 | |||
| 2123 | fbdev->displays[fbdev->num_displays++] = dssdev; | 2125 | fbdev->displays[fbdev->num_displays++] = dssdev; |
| 2124 | } | 2126 | } |
| 2125 | 2127 | ||
| 2128 | if (r) | ||
| 2129 | goto cleanup; | ||
| 2130 | |||
| 2126 | if (fbdev->num_displays == 0) { | 2131 | if (fbdev->num_displays == 0) { |
| 2127 | dev_err(&pdev->dev, "no displays\n"); | 2132 | dev_err(&pdev->dev, "no displays\n"); |
| 2128 | r = -EINVAL; | 2133 | r = -EINVAL; |
