Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1331154rwi; Thu, 13 Oct 2022 12:08:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Upq3ZDKYsD83nbELdLzZQzefhEzeXr8cC6Kzh7kP1NQDhKaWYy1qsFMarzrhxVFbSJfsB X-Received: by 2002:a17:902:f64d:b0:178:a963:d400 with SMTP id m13-20020a170902f64d00b00178a963d400mr1401855plg.6.1665688087171; Thu, 13 Oct 2022 12:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665688087; cv=none; d=google.com; s=arc-20160816; b=EUcP2DvFcJu1p/l7YF7hheB2ljGTmpBH5K7jbFTnNbM2OTkRPI80zQlJK+uqiXj5oc Mp/VBxrozIGpJ7ln4Izy/HGBdBoP5QMqNG6WfZr8eki9qgKYFnyzpLPiSYHkjmsbmVxt 8KROYI0UHxr9Ac6bjza71+OickQUR4BKbHvKaOUi3ecRUxGfTPNjKEF0/7NvNutMsHOV JUoj8MSwydFxX9w1OjnlHvEJFK/89rk1NyI0IIg1RqE2rhkmPvFKVk6X4iq5U8Q6d5Hr YtkUUcoqMclbPd02B3wfOVDnOPDBVk4JtZQRkQZw5BK1E0Z/0AGsBGOnQyDqIS/6kB+p bIPg== 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=qvuPPy773pJrWqG171au/p71V0Jy18OtSHSNc3xbixA=; b=j9nAVsYdNnhpuZli+0g1tOvDvRIKqj5IuCdZ6VC0QXzUq9z2Wta2njon/wpFyKI32x 8xcwd1jenXXGg28SX21mHnWdEz9V+cW3KswQ1knLOeVXEzbayQoMaMX0zLNLLdv9vDwO YM8gt47WkeSHCQWoY54q+VyYS8J8N54iu2oU5MPNcEMXQscpeyQgqv5x+YcbxFKhl1qM vFm97urYzp/rxNhn4d6GZieUG1DQXl19Sz6diRSph6PkFYKmxE31F1+xn4lyZnd/wNP8 XoGIBDhj0F1asCbKKYloA/o0meLQXEVzMAfw8J3dHJQqtaMYiMuS3h/s8Q9KHllrT4/X 8q6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0rX8uIQA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y23-20020aa79437000000b0056187ae2798si163908pfo.179.2022.10.13.12.07.52; Thu, 13 Oct 2022 12:08:07 -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=0rX8uIQA; 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 S229833AbiJMRxy (ORCPT + 99 others); Thu, 13 Oct 2022 13:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbiJMRx0 (ORCPT ); Thu, 13 Oct 2022 13:53:26 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2009915201B; Thu, 13 Oct 2022 10:53:13 -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 sin.source.kernel.org (Postfix) with ESMTPS id B7597CE22CB; Thu, 13 Oct 2022 17:53:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8A81C433C1; Thu, 13 Oct 2022 17:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665683588; bh=gtlsmRQIxOF1aD70zk6aG8lbdASWebPDvTW22e+qgeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0rX8uIQAomkhDJWF59utteLTetuUjGlWPL5pRhiuLu9ef9R2cy3fpCKkGQSxY1TZe xxFPEO9HlsPTzmWHi8ipYo+9zV9hGyZKi3d+gytOPSf1GjmE29mpa6Yvx0Czkj9X5s B06ykDuvzqFpusSKK5y4qTCpA0Ih7a4DBcvBG04s= 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.4 06/38] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Date: Thu, 13 Oct 2022 19:52:07 +0200 Message-Id: <20221013175144.477698452@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221013175144.245431424@linuxfoundation.org> References: <20221013175144.245431424@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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 792776c86ee8..3bb711e735ab 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2703,7 +2703,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