mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
scsi: sym53c8xx_2: iterator underflow in sym_getsync()
We wanted to exit the loop with "div" set to zero, but instead, if we don't hit the break then "div" is -1 when we finish the loop. It leads to an array underflow a few lines later. Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Acked-by: Matthew Wilcox <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
parent
ecf7ff4994
commit
e6f791d953
1 changed files with 1 additions and 1 deletions
|
|
@ -536,7 +536,7 @@ sym_getsync(struct sym_hcb *np, u_char dt, u_char sfac, u_char *divp, u_char *fa
|
|||
* Look for the greatest clock divisor that allows an
|
||||
* input speed faster than the period.
|
||||
*/
|
||||
while (div-- > 0)
|
||||
while (--div > 0)
|
||||
if (kpc >= (div_10M[div] << 2)) break;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue