diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2006-11-14 22:08:16 +0100 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2006-12-01 19:06:05 +0100 |
commit | 89b4e133afea9fce333054b94d89953583a55c19 (patch) | |
tree | 23502a0f8b2bd2ebe0b821a152711746b3457560 /drivers/mmc/mmc_block.c | |
parent | 077df884835ebf2b5db16aacd9a24691d89902a0 (diff) |
mmc: Flush block queue when removing card
After mmc_block's remove function has exited, we must not
touch the card structure in any way. This means we not only
must remove the gendisk, we must also flush out any
remaning requests already queued up.
We previously removed the disk, but didn't flush it,
causing oops:es when removing a card in the middle of a
transfer.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/mmc_block.c')
-rw-r--r-- | drivers/mmc/mmc_block.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index f9027c8db79..5025abebfc8 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c @@ -83,7 +83,6 @@ static void mmc_blk_put(struct mmc_blk_data *md) md->usage--; if (md->usage == 0) { put_disk(md->disk); - mmc_cleanup_queue(&md->queue); kfree(md); } mutex_unlock(&open_lock); @@ -553,12 +552,11 @@ static void mmc_blk_remove(struct mmc_card *card) if (md) { int devidx; + /* Stop new requests from getting into the queue */ del_gendisk(md->disk); - /* - * I think this is needed. - */ - md->disk->queue = NULL; + /* Then flush out any already in there */ + mmc_cleanup_queue(&md->queue); devidx = md->disk->first_minor >> MMC_SHIFT; __clear_bit(devidx, dev_use); |