aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-04 14:11:30 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-16 05:24:45 -0400
commitd3ad0aa4248956399b79a82f9e8ab8155a0f98db (patch)
treea36c78caf871b8a566894a0924ea77b43fb1d4d6
parenta683d652d334a546be9175b894f42dbd8e399536 (diff)
mmc: need to zero sglist on init
Otherwise we could have junk in the sg fields, fooling the sg chaining into thinking ->page is valid. Acked-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--drivers/mmc/card/queue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index b0abc7d92805..a5d0354bbbda 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -153,14 +153,14 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
153 blk_queue_max_hw_segments(mq->queue, bouncesz / 512); 153 blk_queue_max_hw_segments(mq->queue, bouncesz / 512);
154 blk_queue_max_segment_size(mq->queue, bouncesz); 154 blk_queue_max_segment_size(mq->queue, bouncesz);
155 155
156 mq->sg = kmalloc(sizeof(struct scatterlist), 156 mq->sg = kzalloc(sizeof(struct scatterlist),
157 GFP_KERNEL); 157 GFP_KERNEL);
158 if (!mq->sg) { 158 if (!mq->sg) {
159 ret = -ENOMEM; 159 ret = -ENOMEM;
160 goto cleanup_queue; 160 goto cleanup_queue;
161 } 161 }
162 162
163 mq->bounce_sg = kmalloc(sizeof(struct scatterlist) * 163 mq->bounce_sg = kzalloc(sizeof(struct scatterlist) *
164 bouncesz / 512, GFP_KERNEL); 164 bouncesz / 512, GFP_KERNEL);
165 if (!mq->bounce_sg) { 165 if (!mq->bounce_sg) {
166 ret = -ENOMEM; 166 ret = -ENOMEM;
@@ -177,7 +177,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
177 blk_queue_max_hw_segments(mq->queue, host->max_hw_segs); 177 blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
178 blk_queue_max_segment_size(mq->queue, host->max_seg_size); 178 blk_queue_max_segment_size(mq->queue, host->max_seg_size);
179 179
180 mq->sg = kmalloc(sizeof(struct scatterlist) * 180 mq->sg = kzalloc(sizeof(struct scatterlist) *
181 host->max_phys_segs, GFP_KERNEL); 181 host->max_phys_segs, GFP_KERNEL);
182 if (!mq->sg) { 182 if (!mq->sg) {
183 ret = -ENOMEM; 183 ret = -ENOMEM;