From: Harini Katakam <harini.katakam@xilinx.com>
To: <vkoul@kernel.org>, <romain.perier@gmail.com>,
<allen.lkml@gmail.com>, <yukuai3@huawei.com>
Cc: <dmaengine@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <harinikatakamlinux@gmail.com>,
<michal.simek@xilinx.com>, <harini.katakam@xilinx.com>,
<radhey.shyam.pandey@xilinx.com>, <shravya.kumbham@xilinx.com>
Subject: [PATCH 3/4] dmaengine: zynqmp_dma: Add conditions for return value check
Date: Tue, 14 Sep 2021 13:58:16 +0530 [thread overview]
Message-ID: <20210914082817.22311-4-harini.katakam@xilinx.com> (raw)
In-Reply-To: <20210914082817.22311-1-harini.katakam@xilinx.com>
From: Shravya Kumbham <shravya.kumbham@xilinx.com>
Add condition to check the return value of dma_async_device_register
and pm_runtime_get_sync functions.
Addresses-Coverity: Event check_return.
Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
---
drivers/dma/xilinx/zynqmp_dma.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index d28b9ffb4309..588460e56ab8 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -1080,7 +1080,11 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
pm_runtime_set_autosuspend_delay(zdev->dev, ZDMA_PM_TIMEOUT);
pm_runtime_use_autosuspend(zdev->dev);
pm_runtime_enable(zdev->dev);
- pm_runtime_get_sync(zdev->dev);
+ ret = pm_runtime_get_sync(zdev->dev);
+ if (ret < 0) {
+ dev_err(zdev->dev, "pm_runtime_get_sync() failed\n");
+ pm_runtime_disable(zdev->dev);
+ }
if (!pm_runtime_enabled(zdev->dev)) {
ret = zynqmp_dma_runtime_resume(zdev->dev);
if (ret)
@@ -1096,7 +1100,11 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
p->dst_addr_widths = BIT(zdev->chan->bus_width / 8);
p->src_addr_widths = BIT(zdev->chan->bus_width / 8);
- dma_async_device_register(&zdev->common);
+ ret = dma_async_device_register(&zdev->common);
+ if (ret) {
+ dev_err(zdev->dev, "failed to register the dma device\n");
+ goto free_chan_resources;
+ }
ret = of_dma_controller_register(pdev->dev.of_node,
of_zynqmp_dma_xlate, zdev);
--
2.17.1
next prev parent reply other threads:[~2021-09-14 8:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 8:28 [PATCH 0/4] ZynqMP DMA fixes Harini Katakam
2021-09-14 8:28 ` [PATCH 1/4] dmaengine: zynqmp_dma: Typecast the variable to handle overflow Harini Katakam
2021-09-23 14:11 ` Michael Tretter
2021-10-25 6:10 ` Vinod Koul
2021-09-14 8:28 ` [PATCH 2/4] dmaengine: zynqmp_dma: Typecast the variable with dma_addr_t " Harini Katakam
2021-09-14 8:28 ` Harini Katakam [this message]
2021-09-23 14:40 ` [PATCH 3/4] dmaengine: zynqmp_dma: Add conditions for return value check Michael Tretter
2021-10-25 6:12 ` Vinod Koul
2021-09-14 8:28 ` [PATCH 4/4] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning Harini Katakam
2021-09-23 14:17 ` Michael Tretter
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=20210914082817.22311-4-harini.katakam@xilinx.com \
--to=harini.katakam@xilinx.com \
--cc=allen.lkml@gmail.com \
--cc=dmaengine@vger.kernel.org \
--cc=harinikatakamlinux@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=radhey.shyam.pandey@xilinx.com \
--cc=romain.perier@gmail.com \
--cc=shravya.kumbham@xilinx.com \
--cc=vkoul@kernel.org \
--cc=yukuai3@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).