mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
scsi: sym53c8xx_2: iterator underflow in sym_getsync()
[ Upstream commit e6f791d953
]
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 <dan.carpenter@oracle.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ac6572952c
commit
13a3e883ce
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