mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
To: <vkoul@kernel.org>, <dan.j.williams@intel.com>,
	<michal.simek@xilinx.com>, <nick.graumann@gmail.com>,
	<andrea.merello@gmail.com>, <appana.durga.rao@xilinx.com>,
	<mcgrof@kernel.org>
Cc: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<git@xilinx.com>, Shravya Kumbham <shravya.kumbham@xilinx.com>,
	"Radhey Shyam Pandey" <radhey.shyam.pandey@xilinx.com>
Subject: [PATCH v2 1/3] dmaengine: xilinx_dma: check dma_async_device_register return value
Date: Wed, 23 Dec 2020 16:51:00 +0530	[thread overview]
Message-ID: <1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com> (raw)
In-Reply-To: <1608722462-29519-1-git-send-email-radhey.shyam.pandey@xilinx.com>

From: Shravya Kumbham <shravya.kumbham@xilinx.com>

dma_async_device_register() can return non-zero error code. Add
condition to check the return value of dma_async_device_register
function and handle the error path.

Addresses-Coverity: Event check_return.
Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support")
Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
---
Changes for v2:
- Include fixes tag.
---
 drivers/dma/xilinx/xilinx_dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 993297d585c0..e41435be5b79 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3133,7 +3133,11 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 	}
 
 	/* Register the DMA engine with the core */
-	dma_async_device_register(&xdev->common);
+	err = dma_async_device_register(&xdev->common);
+	if (err) {
+		dev_err(xdev->dev, "failed to register the dma device\n");
+		goto error;
+	}
 
 	err = of_dma_controller_register(node, of_dma_xilinx_xlate,
 					 xdev);
-- 
2.7.4


  reply	other threads:[~2020-12-23 11:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 11:20 [PATCH v2 0/3] dmaengine: xilinx_dma: coverity fixes Radhey Shyam Pandey
2020-12-23 11:21 ` Radhey Shyam Pandey [this message]
2020-12-23 11:21 ` [PATCH v2 2/3] dmaengine: xilinx_dma: fix incompatible param warning in _child_probe() Radhey Shyam Pandey
2020-12-23 11:21 ` [PATCH v2 3/3] dmaengine: xilinx_dma: fix mixed_enum_type coverity warning Radhey Shyam Pandey
2021-01-04 12:42 ` [PATCH v2 0/3] dmaengine: xilinx_dma: coverity fixes Vinod Koul

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=1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com \
    --to=radhey.shyam.pandey@xilinx.com \
    --cc=andrea.merello@gmail.com \
    --cc=appana.durga.rao@xilinx.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=git@xilinx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=nick.graumann@gmail.com \
    --cc=shravya.kumbham@xilinx.com \
    --cc=vkoul@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

all inboxes | Powered by JetHome®