diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index b1a263137a23..448ebdaa3d69 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -583,7 +583,7 @@ static struct scatterlist *scsi_sg_alloc(unsigned int nents, gfp_t gfp_mask) | |||
583 | 583 | ||
584 | static void scsi_free_sgtable(struct scsi_data_buffer *sdb, bool mq) | 584 | static void scsi_free_sgtable(struct scsi_data_buffer *sdb, bool mq) |
585 | { | 585 | { |
586 | if (mq && sdb->table.nents <= SCSI_MAX_SG_SEGMENTS) | 586 | if (mq && sdb->table.orig_nents <= SCSI_MAX_SG_SEGMENTS) |
587 | return; | 587 | return; |
588 | __sg_free_table(&sdb->table, SCSI_MAX_SG_SEGMENTS, mq, scsi_sg_free); | 588 | __sg_free_table(&sdb->table, SCSI_MAX_SG_SEGMENTS, mq, scsi_sg_free); |
589 | } | 589 | } |
@@ -597,8 +597,8 @@ static int scsi_alloc_sgtable(struct scsi_data_buffer *sdb, int nents, bool mq) | |||
597 | 597 | ||
598 | if (mq) { | 598 | if (mq) { |
599 | if (nents <= SCSI_MAX_SG_SEGMENTS) { | 599 | if (nents <= SCSI_MAX_SG_SEGMENTS) { |
600 | sdb->table.nents = nents; | 600 | sdb->table.nents = sdb->table.orig_nents = nents; |
601 | sg_init_table(sdb->table.sgl, sdb->table.nents); | 601 | sg_init_table(sdb->table.sgl, nents); |
602 | return 0; | 602 | return 0; |
603 | } | 603 | } |
604 | first_chunk = sdb->table.sgl; | 604 | first_chunk = sdb->table.sgl; |