mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 05:34:00 +08:00
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>
This commit is contained in:
parent
c121b15244
commit
b3f91eb8d8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user