From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1AF4C433EF for ; Mon, 25 Oct 2021 06:13:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C5B760C4B for ; Mon, 25 Oct 2021 06:13:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8C5B760C4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Faf6LKQlmvUrAIStJu8v9ZSSXVZ/+kz1CRQQj24lpbY=; b=VFufft2+6siEey I70o5bAjiPMp82Kiiuhgr33VWxScrCLZ+kico1s/zqp8tRnDVx2HHAsajoQLV6fQolLPbb0JgEitg qTKkN2ctJZqsVZvH/0+XfYIF5f7LDviZ4cXGn1kiwTH5BlWcL8GlN0IocxJg5i6mTGUZFji5d1yHT vxVcah7dGiapFb66YKOrnJ2DQahv9Ins7Xwjcn5ICnPnNNzlbIp5f7IEqmDyc38Ax2zoOKNIIchVn F+ODTo+SMhZR18t1tp6G+EZccZdA2Ew5oRfp0F9ZOJcAUHa87xFtHxnVjxDRLUY5hCKPC3kfBShTS EHrbKdwG+EeX6LiczI6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1metDp-00FNEV-67; Mon, 25 Oct 2021 06:12:37 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1metDl-00FNDl-Nv for linux-arm-kernel@lists.infradead.org; Mon, 25 Oct 2021 06:12:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1767A60F02; Mon, 25 Oct 2021 06:12:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635142353; bh=Eyk0/QdwLpez3FKx+3E7de9QeAfVV2V9Ch+6XzrvUZU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eYmziX4j5TuXVhGhtIhsPPnR5gUqCohOyvqZxGi+Uu5umIX0sdpYwHGUPkMw8Ck4d 82VVMFOm6iduRvUtFwUFtQTYNfcqrtPsO1eDW05/9BKpLzLwNBlCtPHjYZG8tFojT7 IaudZWZo/GBlwBi++f4XiHbU+eeQ2mmDjlZa7JtII8PBHZZndb4ibwFa82uUnkGOnV EBQs1+0fw+KzcMqS5zyYKxb8IAZE8r4whMru4XtmAaA3xN1VIQJcY+3Do1hxvmDQGj LozKe04iLhC0+MWMxun7mIR96dB+mHZSje+S8JmKwkH78RnRbCd429Ln2xG5yD3HLY wFHi57TKivojg== Date: Mon, 25 Oct 2021 11:42:28 +0530 From: Vinod Koul To: Harini Katakam Cc: romain.perier@gmail.com, allen.lkml@gmail.com, yukuai3@huawei.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, harinikatakamlinux@gmail.com, michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com, shravya.kumbham@xilinx.com Subject: Re: [PATCH 3/4] dmaengine: zynqmp_dma: Add conditions for return value check Message-ID: References: <20210914082817.22311-1-harini.katakam@xilinx.com> <20210914082817.22311-4-harini.katakam@xilinx.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210914082817.22311-4-harini.katakam@xilinx.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211024_231233_825877_70020A42 X-CRM114-Status: GOOD ( 18.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14-09-21, 13:58, Harini Katakam wrote: > From: Shravya Kumbham > > 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 sob missing > Reviewed-by: Radhey Shyam Pandey > --- > 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); disable is okay but it wont fix the count, you should call put and then disable if required > + } > 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 -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel