diff options
author | Franck Jullien <franck.jullien@gmail.com> | 2013-07-24 09:17:48 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-08-24 23:22:04 -0400 |
commit | 8efb83a2f8518a6ffcc074177f8d659c5165ef37 (patch) | |
tree | 5861efe1369acfcfaaddc33714a520e1c2c3678c | |
parent | 4be7085f744be070d327ed258d6ceb79b7323f6d (diff) |
mmc: fix null pointer use in mmc_blk_remove_req
A previous commit (fdfa20c1631210d0) reordered the shutdown sequence
in mmc_blk_remove_req. However, mmc_cleanup_queue is now called before
we get the card pointer, and mmc_cleanup_queue sets mq->card to NULL.
This patch moves the card pointer assignment before mmc_cleanup_queue.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/card/block.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index bebcb8e11efb..1a3163f1407e 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -2230,10 +2230,10 @@ static void mmc_blk_remove_req(struct mmc_blk_data *md) | |||
2230 | * is freeing the queue that stops new requests | 2230 | * is freeing the queue that stops new requests |
2231 | * from being accepted. | 2231 | * from being accepted. |
2232 | */ | 2232 | */ |
2233 | card = md->queue.card; | ||
2233 | mmc_cleanup_queue(&md->queue); | 2234 | mmc_cleanup_queue(&md->queue); |
2234 | if (md->flags & MMC_BLK_PACKED_CMD) | 2235 | if (md->flags & MMC_BLK_PACKED_CMD) |
2235 | mmc_packed_clean(&md->queue); | 2236 | mmc_packed_clean(&md->queue); |
2236 | card = md->queue.card; | ||
2237 | if (md->disk->flags & GENHD_FL_UP) { | 2237 | if (md->disk->flags & GENHD_FL_UP) { |
2238 | device_remove_file(disk_to_dev(md->disk), &md->force_ro); | 2238 | device_remove_file(disk_to_dev(md->disk), &md->force_ro); |
2239 | if ((md->area_type & MMC_BLK_DATA_AREA_BOOT) && | 2239 | if ((md->area_type & MMC_BLK_DATA_AREA_BOOT) && |