Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1194051 > unrolled thread

[PATCH 3.12 043/124] hpsa: correct off-by-one sizing of chained SG block

Started byJiri Slaby <jslaby@suse.cz>
First post2015-07-28 12:20 +0200
Last post2015-07-28 12:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.12 043/124] hpsa: correct off-by-one sizing of chained SG block Jiri Slaby <jslaby@suse.cz> - 2015-07-28 12:20 +0200

#1194051 — [PATCH 3.12 043/124] hpsa: correct off-by-one sizing of chained SG block

FromJiri Slaby <jslaby@suse.cz>
Date2015-07-28 12:20 +0200
Subject[PATCH 3.12 043/124] hpsa: correct off-by-one sizing of chained SG block
Message-ID<pRa9m-6eh-69@gated-at.bofh.it>
From: Webb Scales <webbnh@hp.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1a63ea6f244b10117601f96e7bde9f8d21ebe458 upstream.

Correct the size calculation of the chained SG block

Signed-off-by: Don Brace <don.brace@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Reviewed-by: Stephen M. Cameron <stephenmcameron@gmail.com>
Reviewed-by: Don Brace <don.brace@pmcs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/hpsa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index f69a87b06c88..6a03bd550242 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4280,11 +4280,11 @@ static void hpsa_find_board_params(struct ctlr_info *h)
 	h->max_cmd_sg_entries = 31;
 	if (h->maxsgentries > 512) {
 		h->max_cmd_sg_entries = 32;
-		h->chainsize = h->maxsgentries - h->max_cmd_sg_entries + 1;
+		h->chainsize = h->maxsgentries - h->max_cmd_sg_entries;
 		h->maxsgentries--; /* save one for chain pointer */
 	} else {
-		h->maxsgentries = 31; /* default to traditional values */
 		h->chainsize = 0;
+		h->maxsgentries = 31; /* default to traditional values */
 	}
 
 	/* Find out what task management functions are supported and cache */
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web