summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/advansys.c
diff options
context:
space:
mode:
authorMatthew Wilcox2007-10-05 21:57:06 +0200
committerJames Bottomley2008-03-07 17:05:43 +0100
commit951b62c11e86acf8c55d9828aa8c921575023c29 (patch)
treef9caeba567b96d05d22af36a4076bcf81133c897 /drivers/scsi/advansys.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.25 (diff)
downloadkernel-qcow2-linux-951b62c11e86acf8c55d9828aa8c921575023c29.tar.gz
kernel-qcow2-linux-951b62c11e86acf8c55d9828aa8c921575023c29.tar.xz
kernel-qcow2-linux-951b62c11e86acf8c55d9828aa8c921575023c29.zip
[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.c2
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,
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;