X-Received: by 2002:a17:90a:6581:b0:1bc:951:5b2b with SMTP id k1-20020a17090a658100b001bc09515b2bmr2409183pjj.212.1645507715896; Mon, 21 Feb 2022 21:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507715; cv=none; d=google.com; s=arc-20160816; b=Rbqdq5oCCXrNFBSE5CXC7lthI28tzURfbDJ3tosA3VQTQXWtR1hHpX681QTS4t5Iug PpsJXJ9LsGQFKa3L+wuHFz7RGCNbr4ERReJx6WBrLNQB5z5ZyAe483z+8OMi7p/+tTo5 4ovXvEU0jwTVO/GGAilQrkgMwmLFjg59C8p+qL9dpfxsUflNGd9jygkvY6o6Fxnaeftx Bq2VQZ22MLRXS1xG7abGIOSnOmUgxAkTZqaX6LsIMKkJd1Ssr5O1V/qLRhYfh2A+tEUt qQtHVeYGst48zkHvrL0F+5Vne7BLKt9X6PgW+G8YV/DBrvKaPBwpGROnnY79E3Eu6wwQ 6eBw== 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=AI09rul/vDe0YJYDSH4NJSDlZ7YPnMMv2YZWkRFpDAo=; b=yPqa4PBJtDIoADx7BRq4wPRgvng4HgQz3P3eDa9SruajFeKCZDaJ/eBx5k7q3Bkt/f 8FFM5uwgVXqTzFeAVQQ83emKLXzn63s0NLzyjf0rOGUYFRGJLHYXDe1LCuX3VrxYGHwJ icthIrze1Y8dSMFks9HEU9RulyHBOzEk8Vqme9/3mYcJoPMtAIs2X76TDn7QbSDuH3Lb JW5OA3gT/zESyqr7PzOkAMtChRHaBQBKLMIr+BSJ4Hp3ebHfmpmfsJveOrDIxCi3IDua cezZ1OMWrlde8MaG/GXL+XRDZ8qRkl5d2slRko/RZuIY3R07OJHx2JnYGgzrs5PoWPuD zfdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p3tKIDeN; 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 bj1si12981155pgb.726.2022.02.21.21.28.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:28:35 -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=p3tKIDeN; 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 E1FC7BA76D; Mon, 21 Feb 2022 20:57:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353186AbiBUKKU (ORCPT + 99 others); Mon, 21 Feb 2022 05:10:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353428AbiBUJ50 (ORCPT ); Mon, 21 Feb 2022 04:57:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA5D47AC2; Mon, 21 Feb 2022 01:25:38 -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 2121560F8C; Mon, 21 Feb 2022 09:25:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08AD5C340E9; Mon, 21 Feb 2022 09:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435537; bh=Kj5P1zY5l6pTNOhGPDTG6um+5ioqc9DX0x+C/sMtssQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p3tKIDeNGl16zxKzqDQbOqhXtL4H0vnZQ3kaoxKdv0/qouyYou2cIe5joxVAM6cc3 aKk5dWyx6HEVIDE0C4Tmp0N/od9BJ3h4oiWqu5x7ZSKm0xjR77q+/nfIne1O83N9gB xHHZ9T9LqpsAmV7Fh/ItRd9+jCfoaouq/QjH+P2s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Jiasheng Jiang , Vinod Koul Subject: [PATCH 5.16 181/227] dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size Date: Mon, 21 Feb 2022 09:50:00 +0100 Message-Id: <20220221084940.829316946@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 da2ad87fba0891576aadda9161b8505fde81a84d upstream. As the possible failure of the dma_set_max_seg_size(), it should be better to check the return value of the dma_set_max_seg_size(). Fixes: 97d49c59e219 ("dmaengine: rcar-dmac: set scatter/gather max segment size") Reported-by: Geert Uytterhoeven Signed-off-by: Jiasheng Jiang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220111011239.452837-1-jiasheng@iscas.ac.cn Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/sh/rcar-dmac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1868,7 +1868,10 @@ 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); + ret = dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK); + if (ret) + return ret; + ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40)); if (ret) return ret;