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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3DF3C4332F for ; Mon, 10 Oct 2022 07:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231906AbiJJHMg (ORCPT ); Mon, 10 Oct 2022 03:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231708AbiJJHLY (ORCPT ); Mon, 10 Oct 2022 03:11:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9898B22B34; Mon, 10 Oct 2022 00:07:44 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 0152AB80E58; Mon, 10 Oct 2022 07:07:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59436C433D6; Mon, 10 Oct 2022 07:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385662; bh=Fj1SXgH95v2E/aEXj4lS34q5G/k+i666E140ZI19Gno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KE0k0y+Mo8UoC5YZKeKaAlIDKbiTdUIhaNhlmPgDJ2Uqvjl8Bl059jkWiKDC1Y2Fw SLzmZ2+gCDBQXD4uGLROJiWCst1OETerrVvngP17UShPAkkwmEdYn6GLjLEQM1lyMH whgBs1lSbLwGDYngB8vGDGE7KxN/Fnaf/0ijZSVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Swati Agarwal , Radhey Shyam Pandey , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 14/37] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Date: Mon, 10 Oct 2022 09:05:33 +0200 Message-Id: <20221010070331.654715784@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070331.211113813@linuxfoundation.org> References: <20221010070331.211113813@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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 cc7d54f19fb8..4273150b68dc 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -3088,7 +3088,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