summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-11-23 10:19:00 +0100
committerJens Axboe <jens.axboe@oracle.com>2007-11-27 09:19:40 +0100
commit05e5b136459b11cd9559370d5756719e08074fe0 (patch)
tree1e4888953d39ee1905de676b2e6e326e8faa5b57 /drivers/mmc
parentc7674030e5eb83d9ba29318fb9b3ccedf84d583e (diff)
downloadop-kernel-dev-05e5b136459b11cd9559370d5756719e08074fe0.zip
op-kernel-dev-05e5b136459b11cd9559370d5756719e08074fe0.tar.gz
mmc: Add missing sg_init_table() call
mmc_init_queue only initializes the scatterlists with sg_init_table() when using a bounce buffer. This leads to a BUG() when CONFIG_DEBUG_SG is set. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/card/queue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 1b9c9b6..30cd13b 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -180,12 +180,13 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
blk_queue_max_segment_size(mq->queue, host->max_seg_size);
- mq->sg = kzalloc(sizeof(struct scatterlist) *
+ mq->sg = kmalloc(sizeof(struct scatterlist) *
host->max_phys_segs, GFP_KERNEL);
if (!mq->sg) {
ret = -ENOMEM;
goto cleanup_queue;
}
+ sg_init_table(mq->sg, host->max_phys_segs);
}
init_MUTEX(&mq->thread_sem);
OpenPOWER on IntegriCloud