Skip to content

Commit

Permalink
mmc: Add missing sg_init_table() call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Haavard Skinnemoen authored and Jens Axboe committed Nov 27, 2007
1 parent c767403 commit 05e5b13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/card/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 05e5b13

Please sign in to comment.