From patchwork Tue Sep 14 08:28:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harini Katakam X-Patchwork-Id: 12492321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C000C433F5 for ; Tue, 14 Sep 2021 08:33:12 +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 2F23E60F23 for ; Tue, 14 Sep 2021 08:33:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2F23E60F23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com 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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3wiFnQwc0a7tqJERnh9SfJuU98ejO0x08cwPm30A9QA=; b=nIj50HQzD7x037 uXt9t+L7GPLSwPWD++iChiogLaIk/NVZUwc4uT/Laufun3eH/bqe4wJYW6O4LkZ0EauDt2kQh5Mre Rurjc/q3OE13H4C0paajwMXTIBBBFTU46TpEh0ZIaKLl8CddL8ykqIOYLdC7lmvgJUi1b1Ndbg+Xa KhMotT/M1OyYJrsxo1Vk5/fVFPrAjxiDEejoZIqOBUovTVUT572wUQ7UZfeJf1bIpMjWupCWRGz5Q xXcZZ3wQN4aWSi/Bi9k91mHx85raaPz7rGPGSqVxHjD7Jzu1x9gcJdoWCSsSFtUl3YDl32uRpEsUs r75Q5rOEtvN522rz2GXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQ3oh-004gIz-9t; Tue, 14 Sep 2021 08:29:24 +0000 Received: from mail-dm3nam07on2047.outbound.protection.outlook.com ([40.107.95.47] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQ3nw-004g6U-NC for linux-arm-kernel@lists.infradead.org; Tue, 14 Sep 2021 08:28:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k3SZR/EQCaPEAFdBY5nPEcMUP9hUFg4jVCkiuFqXngnJkV2ILljms1wDrcTfDE2Oqo2zLcVb4wmMdqrb2iTfkMhCR4AzN9xoHhEbpFq8GAyKdlCUAIO0e+wyqxLGYlnIf5wADvFc936O3xG9ovluN4DEoiC28lcLY9q5//+iUKiva0rd50YMMjgZT61oNzUvMQGBIgl8nNHb7yROjx9ix2Vk30caYhxC2saRqrXvTFlt9WTT8ew0mbnejQCTj2CQFPNov3jae5OCiQozLybgbRYGZe1VcYK0BZ6+7bU5OFXvuehMR0cjQUxUhmiCQICFA4/VbILYnr0Mtcons03iZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4dbZLk3Ho/PvecpjEqfBcT4ytFxuimA9E8AVIQgheHE=; b=FPB4lgGTBVc6AoH8wyb3iCa5cw+SRo69bXLSu4+GfsqTQQsrsyQfVqvpJuXCLWg8Kl1W/uNzLU2cKX2prWXKTOk4zR2OXLvBMcq7Uw1q2m8St18ZjHJ2/3TjS/SV00orw79rxExscztzyZKPiZqK2bCo0He2g+a0eG9ahlQyPkHNXOpPzCSudCAtHwRlmplSeJ2B/i38uVjlhBpdBmEvPLDZ2NVFJ3PMGRQkqbNy30f+NbXBkhGz0qf4islixtyt68pr/RVCXh5/heF2Trd7cf1Zwk234VQ+Ud5zzJbnssHZOZJgnlLLCAVi1SZlQT5w3y8Xmv62ea6bjgus+Ac1AQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4dbZLk3Ho/PvecpjEqfBcT4ytFxuimA9E8AVIQgheHE=; b=Oyo42GMiUKL2jD0smo54va8NHpTPxDsq/uIizrk583sr4VmXm+1FXD+XzJ3WCe+lRmg8LsIUF02ILWuCoshV70tPKgnNw5N8F35qWbpLZ2myD6E5ZUksyhexdxDe8soz3Mr6u/Zu2R8Pnmzpou1x1LtZEww2h9sNRvg+tk0P7qE= Received: from SN2PR01CA0039.prod.exchangelabs.com (2603:10b6:804:2::49) by MWHPR0201MB3561.namprd02.prod.outlook.com (2603:10b6:301:79::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Tue, 14 Sep 2021 08:28:33 +0000 Received: from SN1NAM02FT0059.eop-nam02.prod.protection.outlook.com (2603:10b6:804:2:cafe::f9) by SN2PR01CA0039.outlook.office365.com (2603:10b6:804:2::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16 via Frontend Transport; Tue, 14 Sep 2021 08:28:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0059.mail.protection.outlook.com (10.97.5.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4500.14 via Frontend Transport; Tue, 14 Sep 2021 08:28:33 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 14 Sep 2021 01:28:31 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 14 Sep 2021 01:28:31 -0700 Received: from [10.140.6.13] (port=35510 helo=xhdharinik40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mQ3nr-00094b-86; Tue, 14 Sep 2021 01:28:31 -0700 From: Harini Katakam To: , , , CC: , , , , , , , Subject: [PATCH 3/4] dmaengine: zynqmp_dma: Add conditions for return value check Date: Tue, 14 Sep 2021 13:58:16 +0530 Message-ID: <20210914082817.22311-4-harini.katakam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210914082817.22311-1-harini.katakam@xilinx.com> References: <20210914082817.22311-1-harini.katakam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf5d2acf-b1d5-4eb5-c095-08d97759a3a7 X-MS-TrafficTypeDiagnostic: MWHPR0201MB3561: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZvwD+b31qnUDcJITFI/qh/Cxzk0RxUsnaH3ML7FsVQCRMVLC7o/UwdHWG+5FAM0DmenCYx2RsP6H7ETc6scUWEKg9xb+zDS5A0Nts9VU/MTd3x7g7JafwhG6cvyY37WgcvqXFJ73jBFLWIbGj5jxUwx4q1WboSr4XjB0GF/gVkIHxPUZrBImRJZPAVBJ+/0+P0AffOMiQE9PcuQXDclEOKpYZcEFa9kSb58GA/fvTcBIHytFmh4e2haUnyYJBsrlYEQlQXg/XnbqXDkTP331Cn6NHR+8EMRlG0+JY4xYmf+Le+nNGqU49xMOL4DDQtHiDsS+75o2kCD/4ezZNBeKnBFkk8rbUf9g2rSV0DAkTnupPg5UU3uhImG7964ksX+Me99qFxBHUF4Z0Rcl6EHYJXJchVrtrLv1J9TzVThSkd+8WkbOj5sCLUizpHcTHDfrblnSVj1TnOD9mJyF4PEtbNSG9eoE6CqdFFrMm5JDZUqMdynR8DPLz6x6R0RJ/q08sIWvWb2i8v7Ne6dY0Z2fWXxWbY58L/5LUH23crx9GTOWxOv62mJK6TYNK6mi0FgfDoEfCGlCeN5htuLxIEWRnYvSSvRf6DYWz4b1DO2mF1l9WTgRPZSKufUYnMB7dFrWymqwLng4+4K36wQOBNBromE+SpA9MvvUcQjKTSVLXwris5Xhhuo0jB2vcArTXfvnHEHPHT7LVmxmtdii/4FUcGXc8x9rOJUk73cc1DLGCZY= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(376002)(136003)(396003)(39860400002)(346002)(46966006)(36840700001)(7636003)(478600001)(26005)(82310400003)(36756003)(1076003)(186003)(82740400003)(8936002)(8676002)(356005)(9786002)(107886003)(2906002)(4326008)(36860700001)(44832011)(5660300002)(426003)(6666004)(83380400001)(70586007)(7696005)(54906003)(70206006)(336012)(2616005)(316002)(47076005)(110136005)(36906005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2021 08:28:33.0310 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf5d2acf-b1d5-4eb5-c095-08d97759a3a7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0059.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0201MB3561 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210914_012836_811659_57BFCD19 X-CRM114-Status: GOOD ( 12.13 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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); + } 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);