]> 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 22:28:14 +0000 (15:28 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 7 Apr 2009 22:28:14 +0000 (15:28 -0700)
commit5dfa79bb765fa132dbc94e4ac40a13e9dfad34d2
tree9d033a7f4d2ea27da4414959d6d9c0f923eeeaf1
parent652eb78e03602d12184fd8283a071c905ce2fa06
[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