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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 74B61C433F5 for ; Sun, 2 Oct 2022 23:05:43 +0000 (UTC) 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=S0dqiI8Ona0XBrzVQuPW1ujE1bgx4gbVHtqlAonCFog=; b=FnrWHn4QiJpSq8 0VI2Zux4MnWH7Tbs7JPh3BmPzU1BfeZWKxnmmYLowA8a5Fdfvq5VS27JXPRYnxo2UdQaD68yAWSE4 3niRQoTQkfAJ0fVeOA1XT8zUSBdDy3oW2hLXTLc0iQRoFYsTIhZgUv0fJG/fFo85iBIBDF1tefN0+ +HME+j+FPWvqZU0tSDpHXKxq5X14pr5KwkbIMlDGuP6ndJx0Ehqkr/rLPZSYIsFCPHeagdInzwZnm 0RjbiUQOWJhiarNrQd5smf65hMy7WgsS7PmNABTBy7Ux5K/uVkWKU9ABEfvqr1j94GriHFGqPL1wb aUOP58phqEqFtwYJ1vBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1of80Z-002w3V-UP; Sun, 02 Oct 2022 23:04:28 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1of7pz-002pLm-Iv for linux-arm-kernel@lists.infradead.org; Sun, 02 Oct 2022 22:53:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2452D60F22; Sun, 2 Oct 2022 22:53:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72519C433D6; Sun, 2 Oct 2022 22:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664751210; bh=MLYHlpHej6WatiXz/o2H6bBtG1Sl1y9g5508EWQT3AE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RG6Nu2XJoEUHI8uxv3v2xl72JNGNQirPDcM5fkFFKr/trlmcFTPAeFixZcl4LsM3u HfsKQIco0WaD5+D6nXdYYombW990LElKO4x0X0UaSBZK8l5RVq+z5vy4nem9eIfDD2 nbLynjujc2LmvBNziWCLJfzGLbpaLa8Z0f/0GijqwnXtfg9KTsxVg4Q8GIuOPchnnE nhOo1PkhgjiLpUkd3Ijyy04Pq5Xh5egPsFuye27wMMJi7rzef05l/9EixWasUJ7Gfz Cv4UgnI9181+Is9IwLYt79814hgTTWJFou6cuy1OPo2WCRMWd7E+VAo3Sk1qBSwVK3 QIzXb7YwCx70w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Swati Agarwal , Radhey Shyam Pandey , Vinod Koul , Sasha Levin , michal.simek@xilinx.com, lars@metafoo.de, adrianml@alumnos.upm.es, shravya.kumbham@xilinx.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.14 2/6] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Date: Sun, 2 Oct 2022 18:53:17 -0400 Message-Id: <20221002225323.240142-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221002225323.240142-1-sashal@kernel.org> References: <20221002225323.240142-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221002_155331_707127_56F45474 X-CRM114-Status: GOOD ( 14.14 ) 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 From: Swati Agarwal [ Upstream commit 8f2b6bc79c32f0fa60df000ae387a790ec80eae9 ] The driver does not handle the failure case while calling dma_set_mask_and_coherent API. In case of failure, capture the return value of API and then report an error. Addresses-coverity: Unchecked return value (CHECKED_RETURN) Signed-off-by: Swati Agarwal Reviewed-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/20220817061125.4720-4-swati.agarwal@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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 9319349e69d2..b4d00bc461db 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2585,7 +2585,11 @@ static int xilinx_dma_probe(struct platform_device *pdev) xdev->ext_addr = false; /* Set the dma mask bits */ - dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width)); + err = dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width)); + if (err < 0) { + dev_err(xdev->dev, "DMA mask error %d\n", err); + goto disable_clks; + } /* Initialize the DMA engine */ xdev->common.dev = &pdev->dev; -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel