]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[OMAP,sDMA] Fix for possible race condition in omap_free_dma()
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Tue, 7 Apr 2009 17:24:52 +0000 (10:24 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 7 Apr 2009 17:27:01 +0000 (10:27 -0700)
commitaef5fe3054f15de121b64f8234974cbc134fa709
tree293aee249808d16fe5dd06101126c00894c75ff8
parent7d7137897a95e8bf74f54c0df672ad481b216097
[OMAP,sDMA] 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