Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3709214pxb; Mon, 21 Feb 2022 04:15:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwt9FgPa9W9H/DolyNud1p1Vn0gV2ghRQGBAgV6FptryTHNm3TobI9nBXvzWYXIQ62kwcgN X-Received: by 2002:a17:907:29c6:b0:6c7:e441:9e07 with SMTP id ev6-20020a17090729c600b006c7e4419e07mr15905891ejc.293.1645445710214; Mon, 21 Feb 2022 04:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645445710; cv=none; d=google.com; s=arc-20160816; b=uOqGJJh9ecpcCzNl5KT/RWDW/p+w+ttQ7XVaSeU3faoEhXE9ea5sEOS/WAcB0ANHaL pgljPj9SEavAgsBRfsy5CBhELrmcxTKolwREkGGyUgQIPJBlrWGFS/9EhTKdDfQVmXFm dxvfK8YE8Dt65RuT/AUuj3zjD4iq1UYObp3no0n4XgFzI1rA8Ilbh1P8d7aOeLUyz8ye 5pnblIcyG7mRErKhMkeFSd3uQofUIQ3Hd3t7WNgp2ebHYnCd3+wCZQdJ1PRDYfR/Qxma T+a9tVLvAZvECE4+puemwcslXPZ9RrjiStkZ3qDoYa0csbaYr2THOrMxlwzCpAz6Kw+3 iJdw== 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=f3DkKKfjVxxQS/29nuoYN5c/bWrjdi6+xK9B0/3idxs=; b=KZqhmKzT0lk1OmaaIX/PpNEmoXIhoTOgq5wfDNQntCN95kYSixx8MBf5Roxm25cPTH 49+NsW4PANQYS4HD5hF9+ijyowytBnTzTRXgdOGf00mhXB/jno22qEeS/ycSA5+mdHfW zSbTvxXR7ZOGFg7yEazzGLzVydSFiKWLBlKRgVwx2Pv3f30caWZPyMM91AeY592AlEdV /UG310wJmbvZsnL11mhevAghuxwa6/RbhU924pRgFAcWhk8lFmkYokp+rtxlw6WXN2AA 8TovzHdqMIxbwYEH68gj/EjkAlLryBRiYvTr6ZLnDJigB0SUuE68D9dqchVdq4vlOlFS AfIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=e5yLTQHB; 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 ca9si5561029ejb.771.2022.02.21.04.14.47; Mon, 21 Feb 2022 04:15:10 -0800 (PST) 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=e5yLTQHB; 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 S1349083AbiBUJMB (ORCPT + 99 others); Mon, 21 Feb 2022 04:12:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347743AbiBUJHn (ORCPT ); Mon, 21 Feb 2022 04:07:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E527924591; Mon, 21 Feb 2022 01:00:10 -0800 (PST) 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 C74C861132; Mon, 21 Feb 2022 09:00:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA503C340E9; Mon, 21 Feb 2022 09:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434010; bh=bJ4V2Ngq7iuxbnHxgEVz9C+hREZ7+XAYQ/q0J3XR8k4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e5yLTQHBOLU6WTvmiM5o20kqCJ5VKQ0AFrRN2pFoISIUTWz5tiwqq2fd0+EbCe2w7 hV7VXEpWv7cwpqRRmHc8/y7oUHeS/e3ECrG/U0x1SJIsbuk8hci+Nqc2Kb0HbGJh9q nUoHukthPfYi22kuW/NhnCi0HdeTUCtSyYj8VJtU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Geert Uytterhoeven , Vinod Koul Subject: [PATCH 5.4 62/80] dmaengine: sh: rcar-dmac: Check for error num after setting mask Date: Mon, 21 Feb 2022 09:49:42 +0100 Message-Id: <20220221084917.619681415@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@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=-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,T_SCC_BODY_TEXT_LINE 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: Jiasheng Jiang commit 2d21543efe332cd8c8f212fb7d365bc8b0690bfa upstream. Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. Fixes: dc312349e875 ("dmaengine: rcar-dmac: Widen DMA mask to 40 bits") Signed-off-by: Jiasheng Jiang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220106030939.2644320-1-jiasheng@iscas.ac.cn Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/sh/rcar-dmac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1825,7 +1825,9 @@ static int rcar_dmac_probe(struct platfo platform_set_drvdata(pdev, dmac); dmac->dev->dma_parms = &dmac->parms; dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK); - dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40)); + ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40)); + if (ret) + return ret; ret = rcar_dmac_parse_of(&pdev->dev, dmac); if (ret < 0)