Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2989334lqt; Tue, 23 Apr 2024 07:36:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVklJ7HQub+5A20RU/p4Fqq06Dg2yeRY8wpeBkGfv7UMmlBuGN5ciCeRq+Fk5uRGUuvvDcg6/KDrzRT0kn4ar2EtCVRsbW9CaLjRlClBA== X-Google-Smtp-Source: AGHT+IFaw8CbuklVFoRsWrKLZzazY+kK6xIkAnqH7c7ITG9BKy//RxIjJZ3wEGBwn4zb3CUlfrgI X-Received: by 2002:a05:6a20:3d94:b0:1a3:52ef:cc84 with SMTP id s20-20020a056a203d9400b001a352efcc84mr14324285pzi.60.1713882962168; Tue, 23 Apr 2024 07:36:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713882962; cv=pass; d=google.com; s=arc-20160816; b=lr7CWnV4peH8Odr6dA2Qe0XMhszryoZLO07ngTulpXe1emKOareOPsik8iB5/YtsaX m5v8o60pAS0SCOm+cCAmdYUEj0cI+CXmH3zbrCE4i/gpVsdMgjSukVgHQXpVwdEk7VCb s6exeRVRgM3n51vTq+WGIn4wtI05bSiiYjTalRgEKReE2x40ctrUmRibH7zMuR13w+UW ObFYN87jYojasXLanh+/d6nsImcdIst4+icpL4WuUjg4BLOIer4DpNGUlxYVECedCW8L QI9A9m042ZxKImqPIqcok0+qAAu2FoEJNiSE1D61viyQstO9spdT22AGB5OXQsCPQHAE cBKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ARYwgqGlUlLRaTcXZttU9ahIzTed8W0mvg6q9Al2vLc=; fh=PRuiPGlwSlm83xJfji1QC2cPRHnjiaJuA55y4hW5Vk4=; b=rdSWM9iQ6r3f67y71+fhu33Tu8Y+UWeF0Bevoa2KO9ot3sB2GN2zX/IHcSiX7+U4OW 2saOVxl6+2szR2MnCIiaDxZyWQ4zWHemJ4kqMqUDVoYkisysE6bau6xgHGYB1BItALEx U/nezWAzYCFx/rPMV9OBxMgLBbGEiRbwF15M8/K90wBelBb1hgG1FSwF9NqRmlzXDCOs qiB1ojN70m38GmHykI6HQ7SvB1CbNMRkDiKPYYePqOgnz/Xt+yazRqu4qu8dlr+oCKas xj8zA0JMig7sxMJADyX8VZn0MS03QeSRpyTVZf25o1SrJXCncFSzcBUC1en8/O+9mah1 ey4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=YHarZTkS; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-155381-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155381-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j3-20020a056a00174300b006e6ca7264b0si9832036pfc.42.2024.04.23.07.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 07:36:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155381-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=YHarZTkS; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-155381-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155381-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 75999289C30 for ; Tue, 23 Apr 2024 14:33:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDD5E84E02; Tue, 23 Apr 2024 14:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="YHarZTkS" Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B0B719470; Tue, 23 Apr 2024 14:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.50.220 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713882782; cv=none; b=jIivSPu8ndYGoB3ZYhV/IIc5Ytk3Hrmp/rcJtHgfG5o6wUFrA4nSqryfInFwJYl1jR5Ejh3pGDsbH3TCmagGzRy9jkjKLt6I2FsZOOtXq21sAkWAFeQ4dzyKGt7CHWU8hqH0HUkJCFFzwj7XMMvNG98gSkjNuNcEfrYlm24uQsw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713882782; c=relaxed/simple; bh=rhanHVe3z+7fCFfPykj623sG54XyU9274IQHaPm11Hk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=SpIwSRwgl1snTRKbLDRqL0w7ra7kAc1yEOWsXw7ZnolNer6SQ3a23DCYuW7QtliicAiHvsjy7o/wPh4nlcueiACiGr8ZP2fjBKzpLcTAfmwXFASXj9mompXIY401TlZul0JzdYt68M5DJzO+zzxZ+818chY4eoEBvFU9O3JziC8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=YHarZTkS; arc=none smtp.client-ip=45.254.50.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=ARYwg qGlUlLRaTcXZttU9ahIzTed8W0mvg6q9Al2vLc=; b=YHarZTkSNPVFAAlOYA/VX hz/5+Eg9eOOB/qA9I5n9lhnyqWS7VbTbE4bLK9Q5LjV/ftbFm90jSXAUU0wRRMZh G7LZcOohnXtzOfX6MkMBadDP0ZXohHWhP4xo+MvhGEfEY//Fu1raOf9eTJ6fKIb9 qlkwU/ODkqDcAL7IBZM1nE= Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wD3P65oxidmlQBkCA--.58334S4; Tue, 23 Apr 2024 22:32:17 +0800 (CST) From: Ma Ke To: vkoul@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: dmaengine@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ma Ke Subject: [PATCH] dmaengine: mxs-dma: Add check for dma_set_max_seg_size() Date: Tue, 23 Apr 2024 22:32:05 +0800 Message-Id: <20240423143205.1420976-1-make_ruc2021@163.com> X-Mailer: git-send-email 2.37.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wD3P65oxidmlQBkCA--.58334S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xw43ZF43Xw47Xw4kAF4rAFb_yoWfKFX_Z3 WUurn3XFn8Wr4rtw13KrsxAw4IqF9IgFZ7uF13tayftr17uFnaqr4DZrykXry8Za17CFWq 934UXrWSvr4DujkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRNkucJUUUUU== X-CM-SenderInfo: 5pdnvshuxfjiisr6il2tof0z/1tbizRLJC2V4G40UqwAAsp To avoid the failure of dma_set_max_seg_size(), we should check the return value of the dma_set_max_seg_size(). Signed-off-by: Ma Ke --- drivers/dma/mxs-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index cfb9962417ef..90cbb9b04b02 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -798,7 +798,9 @@ static int mxs_dma_probe(struct platform_device *pdev) mxs_dma->dma_device.dev = &pdev->dev; /* mxs_dma gets 65535 bytes maximum sg size */ - dma_set_max_seg_size(mxs_dma->dma_device.dev, MAX_XFER_BYTES); + ret = dma_set_max_seg_size(mxs_dma->dma_device.dev, MAX_XFER_BYTES); + if (ret) + return ret; mxs_dma->dma_device.device_alloc_chan_resources = mxs_dma_alloc_chan_resources; mxs_dma->dma_device.device_free_chan_resources = mxs_dma_free_chan_resources; -- 2.37.2