From patchwork Mon Oct 24 11:28:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8680 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp422312wru; Mon, 24 Oct 2022 05:22:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5uxXkaZfxa2iQcTyMMACUbdrTHkWulwpGLgsS4x78t1B6fglizmmK77vs4DAbfDdFy1oCC X-Received: by 2002:a17:906:4a09:b0:78d:b6bb:ff5f with SMTP id w9-20020a1709064a0900b0078db6bbff5fmr26277691eju.538.1666614141113; Mon, 24 Oct 2022 05:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614141; cv=none; d=google.com; s=arc-20160816; b=OhjxrgL1w5lGGQf/1v9JPrKu/exfsq4Ylv1VwJabff8kIawSCXZgRqxUrWtVy7kSyP RS567cd0+wUfor5MfBt6JAsKDGJWobHcz0AVT5Sl/VAC07pDzNowr/umt7p0bTVldh80 mJ0slsA3qB6FpfnhHcDANEzhLhTJDM0raCckEzTIvFl11VxuBiwFT6niyjO6BstdZv8f t1r/BEtgMEv0NQAaTrjafvA9faRQS325zPTnO2Nk61pBdq13Jam2kpw58bEJNSg0pNKE g4lr3K6hL/JlggBQhpy5G3+khCUyApO5NfoXL+OqRmO0wqkCelCIAqDTxK9fuRszuO4X qXaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w955c8chhQa/V1yjdvlmKNDAdSC0STi9VH34C9q484Y=; b=pVLbXL1EjlR9HfUHvKhgd25fEzdHVYKDhL9cBfLvHqJp02dB0M6dEgg15pPFnEiFOS /GLKRs7khiccPF/forEswf9J721ZVfIlvubz/K1OBXjkgNTwi047LZqNKL0JbvKA6mJ2 blGAqjaJZxH05d8Z4XtLIw33QuWtUpuBQFLcS8FauXdMsbL7OR6cgDS8pApincwax1jq Xu42rMhGMKutX8f45YvXYil0aBWCwbv81u9e0xkHKMS7uI+ZKjJd79d5Mby8le/hlVbb THBGKy+QVom4Zbaxk2OCGv0kChsCNnjJvmK+fiA5lhUigh7Dqqyn5M9jLX1uJqgYAtqf Z/9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="INOL/Vcp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a056402270a00b0045dc9b4c034si21351519edd.582.2022.10.24.05.21.57; Mon, 24 Oct 2022 05:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="INOL/Vcp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233231AbiJXMUS (ORCPT + 99 others); Mon, 24 Oct 2022 08:20:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233273AbiJXMTF (ORCPT ); Mon, 24 Oct 2022 08:19:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A02982842; Mon, 24 Oct 2022 04:57:33 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D5016612DB; Mon, 24 Oct 2022 11:55:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5B79C433C1; Mon, 24 Oct 2022 11:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612526; bh=fSVz+OkgMcoaGQ/swcxjK7pSryFkqY9VNBJa73jPodY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=INOL/VcpuRPIlhpUFoO9DlAcdvD3sTWUWtWzDMqJUlP1znwD2/CMbC2ps9C9/J9iE x7GF7rVemaCxYTgcn/KMMQXNVMHkrd5Fc80/BaCLkrQKxLd1kPU5iO3njBa1p7oEsw 4RFyEkeJ31+2LqvbYtRWQaRCUmOyckVfTABiSOng= 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 4.19 007/229] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Date: Mon, 24 Oct 2022 13:28:46 +0200 Message-Id: <20221024112959.355783611@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747571589794453818?= X-GMAIL-MSGID: =?utf-8?q?1747571589794453818?= 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 f72803587b8f..0ba70be4ea85 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2674,7 +2674,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;