From patchwork Mon Oct 24 11:29:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp403109wru; Mon, 24 Oct 2022 04:51:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM716GwtWFjhaXrDwwQxPCcxFsKsBFXnLdU4TpcJ1W13qd3IUqDHd5FMmaePMaZrHaXImiCb X-Received: by 2002:a17:902:edcd:b0:17a:6fa:228d with SMTP id q13-20020a170902edcd00b0017a06fa228dmr32932235plk.29.1666612278564; Mon, 24 Oct 2022 04:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612278; cv=none; d=google.com; s=arc-20160816; b=oux/cW0YAKwsxO1rsjkmtq6vYP+bBlXMuVXwrLUjCNphnrmadA/y8Bu8znG4eccGfF PbotKS6J9PRQltDG4KCtUyRKq5jzNwmcfR4cFlblO0ddo3wr3itmZ3Fn6hxIZ5U8f6QU eH20INpS2/Q3jHLvXH2j5yP0LGTKTFec8WGxkqI/KVsG9OpKKJJDPSwyY5GtChrxuOZq qfckMiKHMhcMD61k5ctQw10OSEgXBCDZMyoghXTPxZUHmz3Ew2VVkUDooD4BLUigsX9e X4YZn4/vHjy5BiIIfwK8OzOOIQIP0JsS5Q1Sw/ZP8JWxCEbguDtU5KbXltcBUFGvTNev PvTw== 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=NSkfdxKazWNEQ3+goCW/a3tkos6GwID5TAHM9MIjDTw=; b=v0kicOHO2VzcNNFmE7K3YKOmmhwLSuSef7lG5ZNn+bgo8PXZIZygvmpPYU0kJQLrqK WqM/BhIAxMWdig68bHHry/tgK/XZozwZDaCVPDLuhv+r1E76gjNUS3fWb2K1VW+B7Mpn w2wSIpAutTOBdMuVv/GCYvBqtY1n906f4iIz9xYUUbI8TpsglwGvcWGKXHlDWde9bEnj pUn4r2LhH9hyJDpTeMWof+g8jAQySinP7E59C65w2wzZ3CJlFBXhUCHhXdn3kXjgOlUX x2IN2s7vskWTguPNMcWlmwBbkRltE8g7RTyf/svydn9/zJ1LQ6m9FRZHxPM1zk8WffAI 7DwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hLyBQEf8; 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 l3-20020a056a00140300b00565cb1ebdb8si39746963pfu.275.2022.10.24.04.51.05; Mon, 24 Oct 2022 04:51:18 -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=hLyBQEf8; 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 S231886AbiJXLus (ORCPT + 99 others); Mon, 24 Oct 2022 07:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbiJXLtI (ORCPT ); Mon, 24 Oct 2022 07:49:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 067FA6D860; Mon, 24 Oct 2022 04:43:43 -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 EF9C9B81181; Mon, 24 Oct 2022 11:40:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46393C433D7; Mon, 24 Oct 2022 11:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611628; bh=zBzveb6Rt/VegdNsHPwco7gQy8Syv60pycr/MYw/PxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hLyBQEf87xzTD7Gi2SfhnfMh42/DsHIq7ebuqZlEMYt8myeiYVXFqQoSGl+FPQtz0 cGdU2R8E9gTqxZRn9XK+s0LnerXYVlbUAsawx6Q0GbaxWjrpL17yvx6L0qgQPvu/Z+ vdWrk2lTjuH00KUx/cOwjmM0Vw3yOXqXDNJWCuEk= 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.9 020/159] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Date: Mon, 24 Oct 2022 13:29:34 +0200 Message-Id: <20221024112950.122771999@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@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?1747569636735808418?= X-GMAIL-MSGID: =?utf-8?q?1747569636735808418?= 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 c0ee6859cdfc..12e26dd8d442 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2578,7 +2578,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;