Skip to content

Commit

Permalink
OMAP: DSS2: OMAPFB: fix dssdev cleanup on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomi Valkeinen committed Feb 18, 2010
1 parent c121b15 commit b3f91eb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/video/omap2/omapfb/omapfb-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b3f91eb

Please sign in to comment.