Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933641AbbG1KQV (ORCPT ); Tue, 28 Jul 2015 06:16:21 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:34431 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932477AbbG1JpI (ORCPT ); Tue, 28 Jul 2015 05:45:08 -0400 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Webb Scales , Don Brace , Christoph Hellwig , Jiri Slaby Subject: [PATCH 3.12 043/124] hpsa: correct off-by-one sizing of chained SG block Date: Tue, 28 Jul 2015 11:42:57 +0200 Message-Id: <4449cb0ac9b1955eace40c33b335187d9a43fafe.1438076484.git.jslaby@suse.cz> X-Mailer: git-send-email 2.4.6 In-Reply-To: <90d8a5681e4a9e320611b422f0ed012e148c2bca.1438076484.git.jslaby@suse.cz> References: <90d8a5681e4a9e320611b422f0ed012e148c2bca.1438076484.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1593 Lines: 46 From: Webb Scales 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 Signed-off-by: Webb Scales Reviewed-by: Stephen M. Cameron Reviewed-by: Don Brace Signed-off-by: Christoph Hellwig Signed-off-by: Jiri Slaby --- 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/