Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763863AbYCUWvd (ORCPT ); Fri, 21 Mar 2008 18:51:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759021AbYCUWqj (ORCPT ); Fri, 21 Mar 2008 18:46:39 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:34773 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762794AbYCUWqg (ORCPT ); Fri, 21 Mar 2008 18:46:36 -0400 Message-Id: <20080321224454.847882820@sous-sol.org> References: <20080321224250.144333319@sous-sol.org> User-Agent: quilt/0.46-1 Date: Fri, 21 Mar 2008 15:44:04 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org, jejb@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Matthew Wilcox , Matthew Wilcox , James Bottomley , Greg Kroah-Hartman Subject: [patch 74/76] SCSI advansys: Fix bug in AdvLoadMicrocode Content-Disposition: inline; filename=scsi-advansys-fix-bug-in-advloadmicrocode.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1213 Lines: 35 -stable review patch. If anyone has any objections, please let us know. --------------------- From: Matthew Wilcox buf[i] can be up to 0xfd, so doubling it and assigning the result to an unsigned char truncates the value. Just use an unsigned int instead; it's only a temporary. Signed-off-by: Matthew Wilcox Signed-off-by: James Bottomley Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/advansys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -6439,7 +6439,7 @@ static int AdvLoadMicrocode(AdvPortAddr i += 2; len += 2; } else { - unsigned char off = buf[i] * 2; + unsigned int off = buf[i] * 2; unsigned short word = (buf[off + 1] << 8) | buf[off]; AdvWriteWordAutoIncLram(iop_base, word); len += 2; -- -- 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/