提交 b3f91eb8 编写于 作者: T Tomi Valkeinen

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: NTomi Valkeinen <tomi.valkeinen@nokia.com>
上级 c121b152
...@@ -2111,18 +2111,23 @@ static int omapfb_probe(struct platform_device *pdev) ...@@ -2111,18 +2111,23 @@ static int omapfb_probe(struct platform_device *pdev)
fbdev->dev = &pdev->dev; fbdev->dev = &pdev->dev;
platform_set_drvdata(pdev, fbdev); platform_set_drvdata(pdev, fbdev);
r = 0;
fbdev->num_displays = 0; fbdev->num_displays = 0;
dssdev = NULL; dssdev = NULL;
for_each_dss_dev(dssdev) { for_each_dss_dev(dssdev) {
omap_dss_get_device(dssdev); omap_dss_get_device(dssdev);
if (!dssdev->driver) { if (!dssdev->driver) {
dev_err(&pdev->dev, "no driver for display\n"); dev_err(&pdev->dev, "no driver for display\n");
r = -EINVAL; r = -ENODEV;
goto cleanup;
} }
fbdev->displays[fbdev->num_displays++] = dssdev; fbdev->displays[fbdev->num_displays++] = dssdev;
} }
if (r)
goto cleanup;
if (fbdev->num_displays == 0) { if (fbdev->num_displays == 0) {
dev_err(&pdev->dev, "no displays\n"); dev_err(&pdev->dev, "no displays\n");
r = -EINVAL; r = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册