diff --git a/arch/arm/src/sama5/sam_dmac.c b/arch/arm/src/sama5/sam_dmac.c index 9c0b3940ac..d6831210e4 100644 --- a/arch/arm/src/sama5/sam_dmac.c +++ b/arch/arm/src/sama5/sam_dmac.c @@ -1482,12 +1482,14 @@ static void sam_freelinklist(struct sam_dmach_s *dmach) while (desc != NULL) { + /* Valid, in-use descriptors never have saddr == 0 */ + + DEBUGASSERT(desc->saddr != 0); + /* Get the physical address of the next desriptor in the list */ paddr = desc->dscr; - DEBUGASSERT(desc->saddr != 0); - /* Free the descriptor by simply nullifying it */ memset(desc, 0, sizeof(struct dma_linklist_s));