Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4407112pxb; Mon, 21 Feb 2022 20:34:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLQqWT7BUBbWH6xpp3I5JnICMKS+ounogddeu+S2/8dJRw+JfN2IZdvH7IuqczZL0R3ngK X-Received: by 2002:a05:6a00:16d6:b0:4e0:ed6a:cf82 with SMTP id l22-20020a056a0016d600b004e0ed6acf82mr22689759pfc.9.1645504495859; Mon, 21 Feb 2022 20:34:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645504495; cv=none; d=google.com; s=arc-20160816; b=SqmnxYgu1MFz6j4xx/Q5IK2RJLLVYwc/yZGAtA6ByrMn9Y/GFDaEIsKrGhPmoHN7fa BTUadtQcUn9cBvWF8wq6xiI9YLa4w0SJ8BNvBDeL8h1EEAN9AHHC7RUs4a+Hbfesguh+ +t/HJz+lALFvIqXCfirvXcNd4zeubkEKO0p2Md8Ive0LAAkMjXUADrDUoMguIioVMhIs tAdXFaqu2fl/6oSj5oYXqbvKUsaOcD0ow71R/Hao54PJZA5KLz5fC35sw5cG7qv6WxzZ coZGL/Z5PIlqkOsktKb55OrGBMFSBIn0Phu6AQ64sb3IKNJ3OukV3IYJ6W+H0ie9GTsj vsgQ== 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=egAJ9xCuHobpap5slgkiCNyppkWKrEGN4YdX3OA6lmQVE/BeubXSJGsEQSTABTTzvm j8FzMexZlZ96ffSgCUbU5jSr4VlOKHe3yEiTyt5k6Xt7M9KCmbu4FyYfTBQrY+FfJJ5n QHt7ZeQmSHPySgqr7GZgkbh3jLOxgiAw7KdNE/rL+hKsNp6NCQ2ms6OlrwahTNfVkybu Q0/YN5z67fyUpUaM868nND6pTBaN0Kkga5m5MUbi8h2UtSvlv2cQSz5kZKg0r7q74Imt CFeNiWKMY/FmNSnRh9I5bQ9vJNHZ1oav96YF/fQr1aWke9JRiQm68YGpC+l5kcLNSyU3 7Ihw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="JQb+A/wW"; 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 v8si26074421ple.59.2022.02.21.20.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 20:34:55 -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="JQb+A/wW"; 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 46A3D7662; Mon, 21 Feb 2022 20:23:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351826AbiBUJql (ORCPT + 99 others); Mon, 21 Feb 2022 04:46:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351635AbiBUJhc (ORCPT ); Mon, 21 Feb 2022 04:37:32 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BFE205CB; Mon, 21 Feb 2022 01:16:17 -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 E8CA260018; Mon, 21 Feb 2022 09:16:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6748C340E9; Mon, 21 Feb 2022 09:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434976; bh=Kj5P1zY5l6pTNOhGPDTG6um+5ioqc9DX0x+C/sMtssQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JQb+A/wWZZVsNCdfvZvOR8nHxF+A35kZq+AL53wzP6UPbVOKc3RS4580weyIY/dBL W/qBvJMZK09Szhtme0uS54oaIyWiQIwJAeGSTQE/2Z40uYwl2jIw3+ctutAr7MmQi3 FAuSVLPCMkC8yL6KccfqZsuFteHEqsnCI+mtgSXY= 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.15 187/196] dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size Date: Mon, 21 Feb 2022 09:50:19 +0100 Message-Id: <20220221084937.206219394@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084930.872957717@linuxfoundation.org> References: <20220221084930.872957717@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;