From: Webb Scales Date: Fri, 14 Nov 2014 23:26:43 +0000 (-0600) Subject: hpsa: correct off-by-one sizing of chained SG block X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1a63ea6f244b10117601f96e7bde9f8d21ebe458;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git hpsa: correct off-by-one sizing of chained SG block Correct the size calculation of the chained SG block Signed-off-by: Don Brace Signed-off-by: Webb Scales Reviewed-by: Stephen M. Cameron Reviewed-by: Don Brace Signed-off-by: Christoph Hellwig --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index f0984c62bec3..4ca94a5373d3 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -6321,11 +6321,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 */