]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 May 2010 21:29:15 +0000 (14:29 -0700)
commiteac2ef18972dbc56c2540c7302a6c7a1437352ef
treeab1e1043d2fc11796119246bd6d2cbfda7eeca13
parent85e346fae9b44a4acfe4d63afae62eae4c25e586
mmc: atmel-mci: prevent kernel oops while removing card

commit 009a891b22395fc86e5f34057d79fffee4509ab5 upstream.

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/mmc/host/atmel-mci.c