Skip to content
Commit 178c81e5 authored by Jingchang Lu's avatar Jingchang Lu Committed by Vinod Koul
Browse files

dma: fsl-edma: fix static checker warning of NULL dereference



The static checker reports following warning:
	drivers/dma/fsl-edma.c:732 fsl_edma_xlate()
	error: we previously assumed 'chan' could be null (see line 737)
The changes of the loop cursor in the iteration may result in
NULL dereference when dma_get_slave_channel failed but loop
will continue. So use list_for_each_entry_safe() instead of
list_for_each_entry() to against this.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJingchang Lu <b35083@freescale.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 7cbccb55
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment