From: Wei Yongjun <weiyj.lk@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Hans Verkuil <hans.verkuil@cisco.com>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Arnd Bergmann <arnd@arndb.de>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-media@vger.kernel.org
Subject: [PATCH -next] [media] pxa_camera: fix error return code in pxa_camera_probe()
Date: Thu, 15 Sep 2016 02:21:45 +0000 [thread overview]
Message-ID: <1473906105-29387-1-git-send-email-weiyj.lk@gmail.com> (raw)
From: Wei Yongjun <weiyongjun1@huawei.com>
Fix to return error code -ENODEV from dma_request_slave_channel_compat()
error handling case instead of 0, as done elsewhere in this function.
Also fix to release resources in v4l2_clk_register() error handling.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/media/platform/pxa_camera.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
index 1bce7eb..8035290 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -2402,6 +2402,7 @@ static int pxa_camera_probe(struct platform_device *pdev)
¶ms, &pdev->dev, "CI_U");
if (!pcdev->dma_chans[1]) {
dev_err(&pdev->dev, "Can't request DMA for Y\n");
+ err = -ENODEV;
goto exit_free_dma_y;
}
@@ -2411,6 +2412,7 @@ static int pxa_camera_probe(struct platform_device *pdev)
¶ms, &pdev->dev, "CI_V");
if (!pcdev->dma_chans[2]) {
dev_err(&pdev->dev, "Can't request DMA for V\n");
+ err = -ENODEV;
goto exit_free_dma_u;
}
@@ -2461,8 +2463,10 @@ static int pxa_camera_probe(struct platform_device *pdev)
pcdev->mclk_clk = v4l2_clk_register(&pxa_camera_mclk_ops,
clk_name, NULL);
- if (IS_ERR(pcdev->mclk_clk))
- return PTR_ERR(pcdev->mclk_clk);
+ if (IS_ERR(pcdev->mclk_clk)) {
+ err = PTR_ERR(pcdev->mclk_clk);
+ goto exit_free_v4l2dev;
+ }
}
err = v4l2_async_notifier_register(&pcdev->v4l2_dev, &pcdev->notifier);
next reply other threads:[~2016-09-15 2:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 2:21 Wei Yongjun [this message]
2016-09-21 6:33 ` [PATCH -next] [media] pxa_camera: fix error return code in pxa_camera_probe() Robert Jarzmik
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=1473906105-29387-1-git-send-email-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=arnd@arndb.de \
--cc=g.liakhovetski@gmx.de \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=robert.jarzmik@free.fr \
--cc=weiyongjun1@huawei.com \
/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).