]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit89ac04ef31e851385ffa59b3ae23d3a4aeed2615
tree2c405438f9f296d15470382c00d4d00b4c42891a
parent1e0aeebdb5124157dd204ae4c92d732bfd7443c5
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