mmc: atmel-mci: prevent kernel oops while removing card
authorNicolas Ferre <nicolas.ferre@atmel.com>
Tue, 11 May 2010 21:06:49 +0000 (14:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 May 2010 00:33:41 +0000 (17:33 -0700)
commit009a891b22395fc86e5f34057d79fffee4509ab5
treed481fdd81ce2e0c561dd22b07cae998ee9d0b72c
parentebb1fea9b3adf25d7e2f643c614163af4f93a17f
mmc: atmel-mci: prevent kernel oops while removing card

The removing of an SD card in certain circumstances can lead to a kernel
oops if we do not make sure that the "data" field of the host structure is
valid.  This patch adds a test in atmci_dma_cleanup() function and also
calls atmci_stop_dma() before throwing away the reference to data.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: <linux-mmc@vger.kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/mmc/host/atmel-mci.c