diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-10-05 15:57:06 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-03-07 11:05:43 -0500 |
commit | 951b62c11e86acf8c55d9828aa8c921575023c29 (patch) | |
tree | f9caeba567b96d05d22af36a4076bcf81133c897 /drivers/scsi/advansys.c | |
parent | ce4796d1e16cf3761dc2a02b8d588667d05b3078 (diff) |
[SCSI] advansys: Fix bug in AdvLoadMicrocode
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 <willy@linux.intel.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/advansys.c')
-rw-r--r-- | drivers/scsi/advansys.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 3c2d6888bb8c..8591585e5cc5 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -6439,7 +6439,7 @@ static int AdvLoadMicrocode(AdvPortAddr iop_base, unsigned char *buf, int size, | |||
6439 | i += 2; | 6439 | i += 2; |
6440 | len += 2; | 6440 | len += 2; |
6441 | } else { | 6441 | } else { |
6442 | unsigned char off = buf[i] * 2; | 6442 | unsigned int off = buf[i] * 2; |
6443 | unsigned short word = (buf[off + 1] << 8) | buf[off]; | 6443 | unsigned short word = (buf[off + 1] << 8) | buf[off]; |
6444 | AdvWriteWordAutoIncLram(iop_base, word); | 6444 | AdvWriteWordAutoIncLram(iop_base, word); |
6445 | len += 2; | 6445 | len += 2; |