[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230923152415.41073-1-liuhaoran14@163.com>
Date: Sat, 23 Sep 2023 23:24:15 +0800
From: liuhaoran <liuhaoran14@....com>
To: linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, liuhaoran <liuhaoran14@....com>
Subject: [PATCH] arm: kernel: Add error handling in get_dma_residue()
This patch adds error-handling for the dma_channel() inside
the get_dma_residue().
Signed-off-by: liuhaoran <liuhaoran14@....com>
---
arch/arm/kernel/dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c
index ba15b8666498..80b3e3506cfa 100644
--- a/arch/arm/kernel/dma.c
+++ b/arch/arm/kernel/dma.c
@@ -253,7 +253,7 @@ int get_dma_residue(unsigned int chan)
dma_t *dma = dma_channel(chan);
int ret = 0;
- if (dma->d_ops->residue)
+ if (dma && dma->d_ops->residue)
ret = dma->d_ops->residue(chan, dma);
return ret;
--
2.17.1
Powered by blists - more mailing lists