bl602/dma: Fix possible call of null pointer to function

This commit is contained in:
Brennan Ashton 2022-10-09 17:04:32 -07:00 committed by Xiang Xiao
parent 9c7bb9e088
commit 4ce8cf7bdc
1 changed files with 7 additions and 1 deletions

View File

@ -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);
}
}
}