aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2008-03-21 15:15:03 +0000
committerChris Wright <chrisw@sous-sol.org>2008-03-24 11:48:30 -0700
commit868145d87bd058f271921c69519d4e2311171d28 (patch)
treedd2b920095becef1435706064861c2bfbaabf9c4
parent5d51c29a9ccf12c169c13d155a22b5e683280604 (diff)
SCSI advansys: Fix bug in AdvLoadMicrocode
commit: 951b62c11e86acf8c55d9828aa8c921575023c29 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> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 ce8ccb04540d..f40417b9517e 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;