From patchwork Wed Jun 26 08:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ma Ke X-Patchwork-Id: 13712410 Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 404083B1A1 for ; Wed, 26 Jun 2024 08:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719391536; cv=none; b=Pt+KQ2h2qD+ztryK+UNdJUP43lGXrVV2VWspFUYN9A05jdC9DcILIn7xd1Y6ft6nERWlNfJfYqbeLo7mH653JiS4bBJ0d5VMwnmKcePRF4ulB8FhsEUgQ6Bd2aSMArQ0SkagXVsL+oujnLxQza31QU6ZmREpqVcWf+y0fShxNto= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719391536; c=relaxed/simple; bh=QCXtTQwQCTkr4Q+pZbpLZTqkGqQg9qNPN6tr95+ABNg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=t9taXtJI8Ldd/zLj4cQCRP+WFMOgBiG8vJt/tQdHWfQrcNlLfmBy+dJUo5+2yirYXq0sgPxytKQb/bklnKkrJ7L1HSWC/Uj7hQ40561K1hLAezLwYSQ+EU2FkghGFPkDxeZroOwitIAej4+ij+OnBvlQ4WQs5yA72tsy0+pls5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by APP-05 (Coremail) with SMTP id zQCowABXXwMc1XtmtNbfEg--.48462S2; Wed, 26 Jun 2024 16:45:27 +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 in mxs_dma_probe() Date: Wed, 26 Jun 2024 16:45:15 +0800 Message-Id: <20240626084515.2829595-1-make24@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: zQCowABXXwMc1XtmtNbfEg--.48462S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Jw47Wr1UAF48Cw13KF18AFb_yoWDurg_Z3 WUuF1fXFn8Wr4Fyw13KrnxCw4Iqr9IqF97uF13ta93try7WF1Sqr4DZr95Jry8ZanrCFWq vw1UXrWSvr4DujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb3xFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6r1F6r1fM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2vYz4IE04k24VAvwVAKI4IrM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVW8JVWxJw Am72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAG YxC7M4IIrI8v6xkF7I0E8cxan2IY04v7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4l IxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvf C2KfnxnUUI43ZEXa7VUjiF4JUUUUU== X-CM-SenderInfo: ppdnvj2u6l2u1dvotugofq/ As the possible failure of the dma_set_max_seg_size(), we should better check the return value of the dma_set_max_seg_size(). Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") 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;