]> git.baikalelectronics.ru Git - kernel.git/commit
dma: fsl-edma: fix static checker warning of NULL dereference
authorJingchang Lu <b35083@freescale.com>
Fri, 21 Feb 2014 06:50:06 +0000 (14:50 +0800)
committerVinod Koul <vinod.koul@intel.com>
Thu, 6 Mar 2014 15:13:57 +0000 (20:43 +0530)
commit65967b823d92a7e2219964e2d2f5c89ece74c9c5
tree82f08ee72646dfd319c34021abe008544adafc9e
parent57fb0458378c9326bb6345a578d3cd769cb5b173
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/fsl-edma.c