From patchwork Mon Oct 24 11:29:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8823 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp431274wru; Mon, 24 Oct 2022 05:43:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5HALXcM3eNpTUWNPY4EISthWKYkIaNAr6QpMrpkiM8VsFyw6qheVZjbBK6mxjrVTr7OzW8 X-Received: by 2002:a17:907:7f20:b0:7aa:acf9:c07f with SMTP id qf32-20020a1709077f2000b007aaacf9c07fmr1193653ejc.559.1666615403080; Mon, 24 Oct 2022 05:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615403; cv=none; d=google.com; s=arc-20160816; b=CQrKGAv5jagNZvWVo0fW7lbDuIEAR6snY9Z5pUIgR1IUBzmiu+zX/EG/uSisgGT8Vi 3EVJFZqMAz2jSOmddF5HY8HI+Di0ckmakXXrkuPjVfUcnoN0OpBFkQHoF+btlthY2eaW vAyD9d7M6SHar4q9xwpQj0xQBilyUEnOwHr+kTYyS8MLLpuOBenIn83mATvgMcx5lVh6 Ncw4cNMX/jo6jX4U7LJR/HBCmR2kazsmP2S9bxe0vfd3pZCn5kHCeGKzwaumQZKPpyRB 1PpqkbZKlxKMMRFi5Leshc/SjcZriOwCWAEUnBTHEhV+f0gEbKma9M4J3k4/GCXJR7ww 6DaQ== 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=R3RiossygA40w9O9uKZDg18URhruYXLYQttWw6JjPn0=; b=zkqQinBzydLhSVShIJGB6ElS9gk5/hatsiaZgozfDHSmEg3ryoKmtqravGhFvxmZma pVcn8lSdemHiA2jr/2JbLWgJxPZipzBfhJZgr7Q1HUtutFDyo9CHbi6b32NcHjfjlNXF wNDiXEQ7fT/wo+iz2+/TcMTg2v9QcwM7AH7fnv7SPQTlijtlzCgSiR+4xbZyArNbdzMS NYOFRgWi3WFJfl5FzpnBl9vcm8D3Fudmp2QYv4CZZ5bGj4krw5r+pI9RqEwL+AOzb4xO owo8LpIby3GVNwD79jcnBcDOAQx6eCN+KzduQxCa5LN4kSDY1QOkmnSha002H4RHTIIn EvUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tSJ3IOrt; 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 dr4-20020a170907720400b00782393c36cfsi3401023ejc.336.2022.10.24.05.42.48; Mon, 24 Oct 2022 05:43:23 -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=tSJ3IOrt; 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 S230432AbiJXMg3 (ORCPT + 99 others); Mon, 24 Oct 2022 08:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234344AbiJXMaF (ORCPT ); Mon, 24 Oct 2022 08:30:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16CB631EF6; Mon, 24 Oct 2022 05:03:57 -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 4CDB6B81147; Mon, 24 Oct 2022 11:46:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA6F3C433C1; Mon, 24 Oct 2022 11:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611983; bh=MLYHlpHej6WatiXz/o2H6bBtG1Sl1y9g5508EWQT3AE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tSJ3IOrtDzEZvQBbwx9rJcNxfYfjGlV9H95S64Ja0Qv2MJEZtYon4y/qAV7NTTVAC PueHDq44VSt57bhukZiy2QgzqBO9bhRSzhNI/QG/kLjjVR8aXcDUwUW+f6UlkHVVZv jnimvtUmhwY9ukAgETvfbaEruOK4JtLS/MoCsmQw= 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.14 025/210] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Date: Mon, 24 Oct 2022 13:29:02 +0200 Message-Id: <20221024112957.780094879@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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?1747572913333046513?= X-GMAIL-MSGID: =?utf-8?q?1747572913333046513?= 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;