]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dma-debug: fix locking bug in check_unmap()
authorAlexander Duyck <alexander.h.duyck@intel.com>
Wed, 20 Mar 2013 04:06:47 +0000 (15:06 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:27:10 +0000 (16:27 +1100)
commit4df07c1318d873037588804b35d33ad11bf14f1b
tree86abbb43869ee7704f257cd9188c77ad2a30164c
parent7cc4e88cb19f4a775cf928f467257e700a27d8fd
dma-debug: fix locking bug in check_unmap()

In check_unmap() it is possible to get into a dead-locked state if
dma_mapping_error is called.  The problem is that the bucket is locked in
check_unmap, and locked again by debug_dma_mapping_error which is called
by dma_mapping_error.  To resolve that we must release the lock on the
bucket before making the call to dma_mapping_error.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Reviewed-by: Shuah Khan <shuah.khan@hp.com>
Tested-by: Shuah Khan <shuah.khan@hp.com>
Cc: Jakub Kicinski <kubakici@wp.pl>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/dma-debug.c