This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 4ce8cf7bdc bl602/dma: Fix possible call of null pointer to function
4ce8cf7bdc is described below

commit 4ce8cf7bdcb6f1812c2beed1d8818f82501eec0f
Author: Brennan Ashton <bash...@brennanashton.com>
AuthorDate: Sun Oct 9 17:04:32 2022 -0700

    bl602/dma: Fix possible call of null pointer to function
---
 arch/risc-v/src/bl602/bl602_dma.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/risc-v/src/bl602/bl602_dma.c 
b/arch/risc-v/src/bl602/bl602_dma.c
index 11a9d9471b..5a1a7a2251 100644
--- a/arch/risc-v/src/bl602/bl602_dma.c
+++ b/arch/risc-v/src/bl602/bl602_dma.c
@@ -120,7 +120,13 @@ static int bl602_dma_int_handler(int irq, void *context, 
void *arg)
         {
           dmainfo("CH %d Error Int fired\n", ch);
           putreg32((1 << ch), BL602_DMA_INTERRCLR);
-          g_dmach[ch].callback(ch, BL602_DMA_INT_EVT_ERR, g_dmach[ch].arg);
+          if (g_dmach[ch].callback != NULL)
+            {
+              g_dmach[ch].callback(
+                ch,
+                BL602_DMA_INT_EVT_ERR,
+                g_dmach[ch].arg);
+            }
         }
     }
 

Reply via email to