Skip to contentSkip to conversation

Drivers: scsi: storvsc: Initialize the sglist

PATCH In review K. Y. Srinivasan 2 participants 2 messages Jan 25, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers: scsi: storvsc: Initialize the sglist

Properly initialize scatterlist before using it.

---
 drivers/scsi/storvsc_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/storvsc_drv.c +1 -0
index 270b3cf..5ada1d0 100644
@@ -467,6 +467,7 @@ static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl,
 	if (!bounce_sgl)
 		return NULL;
 
+	sg_init_table(bounce_sgl, num_pages);
 	for (i = 0; i < num_pages; i++) {
 		page_buf = alloc_page(GFP_ATOMIC);
 		if (!page_buf)
Signature · 1 line
1.7.4.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · K. Y. Srinivasan

Properly initialize scatterlist before using it.

Quoted 17 lines
---
 drivers/scsi/storvsc_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/storvsc_drv.c +1 -0
index 270b3cf..5ada1d0 100644
@@ -467,6 +467,7 @@ static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl,
 	if (!bounce_sgl)
 		return NULL;
 
+	sg_init_table(bounce_sgl, num_pages);
 	for (i = 0; i < num_pages; i++) {
 		page_buf = alloc_page(GFP_ATOMIC);
 		if (!page_buf)