Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4235414pxb; Sun, 24 Oct 2021 23:40:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrCcbAnIrZUOtAuf/LDR0eJpjMyAmzomu/jz+S+qSmWyZNzJgd/Xr+iClCvbVqKaS74uRt X-Received: by 2002:a17:906:d0ca:: with SMTP id bq10mr20076825ejb.25.1635144015313; Sun, 24 Oct 2021 23:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635144015; cv=none; d=google.com; s=arc-20160816; b=WfblJ083LyXiiBt7kyrF092o6E7E+LH4YGbH5gVB2rqBePV9MWSJpLxZHieZy+nfhB tFFhzqQDRSqoZHrqVHWS9lrdVEzYYsEy+5uNvHV2TyMBs0dV989w2Ihvbxxzpxa2apUS oEO8XDJw+e+EFqOnMMSgACM+5a11J7uJIpMDwF4N2YIQ2nQhyztCVQwXXV9AINiWJJ4Y YJyFK3CAF3qaNCQWwrAxsLYtJDYNxDovoB+H0Q4hV03AgPr6aWN+QVLddojKDpa03u5S 6gVTPBXgJmPQzWIgHhrF69BGTlHwIbBVvx2wiu2bYi1zi0G8e1HI4JcfPTj1KFeOaq/a DsIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wAUgUOsxJzL5H3IMUzE8orUqjxf8vkTe3KtDl5xBMDU=; b=SgMtkk9Alm1MfeSJQ02graJmkkeqOsaCrATy6zT2KUxxWHrFcYOlqS29RJxDbWDyh/ zwjzBA67eBsuC4yx0gwxmTTZXlq8bGvIRT03Jgd1gZ88k+DBKg87H36OYqGRsD2ef78g TBLFS4pHCtGqBnpPCzr8p4hNkU3jqBTb5vI7Q03OKTKn4Vbe8A19rVU9W/iD+rsxl30H b88tHuqCzHU82HR0X8EKf7YcGsJB/phk43N5gTD07rKcg58VgNbj3KQBZe+v1jt5lkTe PKhr74gO8U6OauZO9T8KQGxDZUOUN362tNaUlaibUb/oV5k/oDpdPNqgDYaS29ieqn2d pNuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eYmziX4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si31272364edc.7.2021.10.24.23.39.52; Sun, 24 Oct 2021 23:40:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eYmziX4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbhJYGOz (ORCPT + 99 others); Mon, 25 Oct 2021 02:14:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:40980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbhJYGOy (ORCPT ); Mon, 25 Oct 2021 02:14:54 -0400 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210914082817.22311-4-harini.katakam@xilinx.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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