Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4434966pxb; Mon, 21 Feb 2022 21:31:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnNYhCDOz7dMAOErQ4ExvMBpHUrr/6CyqBoKT3ZZqMYC0rONQloqVRlX+ysrea7FKaTphA X-Received: by 2002:a63:2a45:0:b0:373:1850:d5b with SMTP id q66-20020a632a45000000b0037318500d5bmr18190560pgq.563.1645507892674; Mon, 21 Feb 2022 21:31:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507892; cv=none; d=google.com; s=arc-20160816; b=H06gAJKBvRDB8wGZcMsqhfpvFLFnTF17cq//jwLIUmpW2m5RERcY0tUDjRB9Ue1E0c q7bcG6s8HpzYSU1th4U0xnwNFkcOn0IrKX00ux/qlz/tWloDVY15C6vHlo3/v5DUJeFe aTfdDLMS2p3uHXytQhU7jRM780jmSmZS/CSxkWkv0AizSkoQJxF8/sVewRwTd6en5JGY T9ByW+ynRlv+/O+PiMQwq2LczSafa9n4jcBSwLvszh85heVhg/Y+ZIALoxed+0WwV6Ru HqLrbHIvg0fl757mOzcEs8CuQ/BnpwT2SbKmORuSfsTBnUXMrevVJWuWq9ngshwWs4r5 eF7w== 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=30uv3teSy9XGUfcqbp7RUxJdmRiJONat10yaaX0phhg=; b=rwP+aC8LlMWPLwjp7YO43x5iw4ZujpuIUYkeXFqI0y6CtgDVQ/mMUbGMZPWIflMSvF 0dnqEKbDlJUBvTbgrTU6B9xUcZNoIcC5OBEcKOVOZA/PxlYNYt6cAt4SE1NJ10BHdIqV Cirb7eNO5e3QOXFuS7wkZWnX/4bHpUrBGQebI/efjceYOf/4cVL5kyp4/y8/oTg/Pjhk 1SKlQf+Od42lRT4IQGTzSZKHtLRQt3RuSCZFrl5SU5lLsRwVPjpvgybVQXEVWF9+FWzR SCNpZr4V7nqTVxuSAcGFocV65JRk3gy+abidsb46/50yP5wUQ32RE65nmGZfwSQS6JaO lEvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fRNVTid7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id nl14-20020a17090b384e00b001bc0ffb1115si1231327pjb.31.2022.02.21.21.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:31:32 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fRNVTid7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 81CDE10E06D; Mon, 21 Feb 2022 20:59:59 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353004AbiBUKJR (ORCPT + 99 others); Mon, 21 Feb 2022 05:09:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353545AbiBUJ5c (ORCPT ); Mon, 21 Feb 2022 04:57:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54A501D0EE; Mon, 21 Feb 2022 01:26:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id 143F2B80EB1; Mon, 21 Feb 2022 09:26:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D8D9C340E9; Mon, 21 Feb 2022 09:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435602; bh=iL+rlQ5kuc2Mat8DU3mcVFaTxdmYQC76utMHrm2gPHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRNVTid7wHocuqQVV8iw7RHWC4vFFSxNWYZAPnwn9MDpeMQVTkjF0cggugfbzphfh SDMrKT3ZkVyXOZPuKeFN8009kgT0xNxcjN8DvDqzXwAUrDd0ZupiZNzpOYFoRU28Hx q7h7kt+lEhhvHRzHvy5Fq9yFcb3oaKsJZGY35D3w= 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.16 179/227] dmaengine: sh: rcar-dmac: Check for error num after setting mask Date: Mon, 21 Feb 2022 09:49:58 +0100 Message-Id: <20220221084940.760173692@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084934.836145070@linuxfoundation.org> References: <20220221084934.836145070@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 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 @@ -1869,7 +1869,9 @@ static int rcar_dmac_probe(struct platfo dmac->dev = &pdev->dev; platform_set_drvdata(pdev, dmac); 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)