From: Fabio Estevam <festevam@gmail.com>
To: m.chehab@samsung.com
Cc: p.zabel@pengutronix.de, linux-media@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH 2/3] [media] coda: Unregister v4l2 upon alloc_workqueue() error
Date: Sat, 4 Oct 2014 16:40:51 -0300 [thread overview]
Message-ID: <1412451652-27220-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1412451652-27220-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
If alloc_workqueue() fails, we should go to the 'err_v4l2_register' label, which
will unregister the v4l2 device.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/media/platform/coda/coda-common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 7cd82e8..951f1d4 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1971,7 +1971,8 @@ static int coda_probe(struct platform_device *pdev)
dev->workqueue = alloc_workqueue("coda", WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
if (!dev->workqueue) {
dev_err(&pdev->dev, "unable to alloc workqueue\n");
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto err_v4l2_register;
}
platform_set_drvdata(pdev, dev);
--
1.9.1
next prev parent reply other threads:[~2014-10-04 19:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-04 19:40 [PATCH 1/3] [media] coda: Call v4l2_device_unregister() from a single location Fabio Estevam
2014-10-04 19:40 ` Fabio Estevam [this message]
2014-10-05 7:33 ` [PATCH 2/3] [media] coda: Unregister v4l2 upon alloc_workqueue() error Philipp Zabel
2014-10-04 19:40 ` [PATCH 3/3] [media] coda: Remove devm_kzalloc() error message Fabio Estevam
2014-10-05 7:37 ` Philipp Zabel
2014-10-05 7:32 ` [PATCH 1/3] [media] coda: Call v4l2_device_unregister() from a single location Philipp Zabel
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=1412451652-27220-2-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=p.zabel@pengutronix.de \
/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).