From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Subject: [PATCH 3/4] OMAP: DSS2: OMAPFB: fix dssdev cleanup on error
Date: Wed, 17 Feb 2010 11:57:18 +0000 [thread overview]
Message-ID: <1266407839-14713-3-git-send-email-tomi.valkeinen@nokia.com> (raw)
In-Reply-To: <1266407839-14713-2-git-send-email-tomi.valkeinen@nokia.com>
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>
---
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 d17caef..973bf79 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;
--
1.6.5
next prev parent reply other threads:[~2010-02-17 11:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-17 11:57 [PATCH 1/4] OMAP: DSS2: remove sub-panel system Tomi Valkeinen
2010-02-17 11:57 ` [PATCH 2/4] OMAP: DSS2: fix driver probe error handling Tomi Valkeinen
2010-02-17 11:57 ` Tomi Valkeinen [this message]
2010-02-17 11:57 ` [PATCH 4/4] OMAP: DSS2: OMAPFB: fix cleanup on dssdev enable error Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266407839-14713-3-git-send-email-tomi.valkeinen@nokia.com \
--to=tomi.valkeinen@nokia.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).