ARM: OMAP: Fix for possible race condition in omap_free_dma()
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Thu, 23 Apr 2009 18:10:40 +0000 (11:10 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 23 Apr 2009 18:10:40 +0000 (11:10 -0700)
commitda1b94e6a68e1bdeb9cdda016cceb17228b37d25
tree2c405438f9f296d15470382c00d4d00b4c42891a
parent091069740304c979f957ceacec39c461d0192158
ARM: OMAP: Fix for possible race condition in omap_free_dma()

Fix the possible race condition in omap_free_dma(). Function omap_free_dma()
sets the dev_id = -1 and then accesses the channel afterwards to clear it.
But setting the dev_id=-1 makes the channel available for allocation again.
So it is possible someone else can grab it and results are unpredictable.
To avod this DMA channle is cleared first and then the dev_id = -1 is set.

Thanks to McNeil, Sean <sean.mcneil@ti.com> for ointing out this issue.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dma.c