Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp645354pxb; Tue, 5 Apr 2022 17:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw86mMp0tU2rd+i/CfhjIk9XddOnERP7m9vDruI3A6u8oR5uPrFrHlYy+vtQrHyJJk7GEup X-Received: by 2002:a17:903:40c2:b0:156:7203:2e63 with SMTP id t2-20020a17090340c200b0015672032e63mr5861209pld.173.1649203707124; Tue, 05 Apr 2022 17:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649203707; cv=none; d=google.com; s=arc-20160816; b=dJTHvbW7NaDuJprJU7qzugpq+ZNafEC46Vvq+hSb+zw8dEHvEEZ9NBkaSbkpc9HrCC pKFUGP7BiGqcUwYjYfux76LSbZ8Qoo+LHpnPTZs2eSDPMgGO+mh4yfLqm3HFtB+hu5A4 42FKNMHv//Uz7tJmeKiWzqKdVzmiWTPbizAWUgd12y7rSrOuJWp8XrTruh04SjBPwEdo Rg2PR+p6nulNVjek01l1ZbzP5L38SZawYCdprGbzVXZ1slHelxQi1Uf3IuOv7M1d0MYe zVGed+HsYYODXZS9ftj+3xcxw35kaLl9EOrc/vLtnKT2B8Vda58/tFfGQT4L69/mKnR5 Y9dg== 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=Lav0mmSGvQxfd1W/bKt+2FQO/GRcPYTbIrouPTrElXU=; b=QeH/o8CkussRC6orK/uJdUg+0aYjbKvPPSnWGF6wOijGtcYDwVUIx/UeAIa6nxvHxz VUBZ/AM8btCU4qF1V5u+i1qxVIEaPha3BzBR4Pv/kfSbQF9tLdJtqWijzy0Dni6wZq3C pg7SGwwFIYmwow9CCFCZqEILf2aWEAM0vj6GFzWvtMcOIxB4hwnrhchq85xlrBQQ+sSv ShZwF9RYTzxyUF55wHaiNnQK9l2VEMZpYiMpunGeoe6hivOG7GviWsweV2M4M993Fu/k oNR9alf5O2AxP86Nfe5PZH1fc4iTruaQLpz0bTtYm7hT5sRDuUsqmzUQsDOdx+wL4wvR l4Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i4KNzooy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r6-20020a170902be0600b0015621cb59ecsi12929577pls.122.2022.04.05.17.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 17:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i4KNzooy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A4D81546BB; Tue, 5 Apr 2022 16:53:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235211AbiDEPBn (ORCPT + 99 others); Tue, 5 Apr 2022 11:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345007AbiDEJmy (ORCPT ); Tue, 5 Apr 2022 05:42:54 -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 99555BF94C; Tue, 5 Apr 2022 02:28:19 -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 65D40B81C84; Tue, 5 Apr 2022 09:28:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D112EC385AF; Tue, 5 Apr 2022 09:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150897; bh=Kz1byvTD0NJ9nT3np/9/Igd+t/G2GR+z4MqYHVKyA7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i4KNzooy36BixtYiiIVphYudmEx3AsuwPjbBMzHA8/YE5aW/XD78xVOLoGAMVPcb0 6wZZbDV7TXp7DxE5R8n8yMGPLzuwVUPxZuNBU6+JR49BmR2LB9ovqWOyTcIx+Er9Jp Ill+Y0BL5rlg7+6PhWDoqicrgg3YdJA2GbmWoj68= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Mark Brown , Sasha Levin Subject: [PATCH 5.15 221/913] spi: spi-zynqmp-gqspi: Handle error for dma_set_mask Date: Tue, 5 Apr 2022 09:21:23 +0200 Message-Id: <20220405070346.482361704@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Jiasheng Jiang [ Upstream commit 13262fc26c1837c51a5131dbbdd67a2387f8bfc7 ] As the potential failure of the dma_set_mask(), it should be better to check it and return error if fails. Fixes: 126bdb606fd2 ("spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220302092051.121343-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-zynqmp-gqspi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 328b6559bb19..2b5afae8ff7f 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -1172,7 +1172,10 @@ static int zynqmp_qspi_probe(struct platform_device *pdev) goto clk_dis_all; } - dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); + ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); + if (ret) + goto clk_dis_all; + ctlr->bits_per_word_mask = SPI_BPW_MASK(8); ctlr->num_chipselect = GQSPI_DEFAULT_NUM_CS; ctlr->mem_ops = &zynqmp_qspi_mem_ops; -- 2.34.1