sym53c8xx: Read buffer overflow
PATCH 1/1 sym53c8xx: Read buffer overflow
Prevent read from div_10M[-1] when no clock divisor was greater.
Signed-off-by Roel Kluin <[email protected]>
---
Can this happen?
drivers/scsi/sym53c8xx_2/sym_hipd.c +3 -0
@@ -542,6 +542,9 @@ sym_getsync(struct sym_hcb *np, u_char dt, u_char sfac, u_char *divp, u_char *fawhile (div-- >0 )if (kpc >= (div_10M[div] <<2 ))break ; +if (div <0 ) +return -1 ; +/* * Calculate the lowest clock factor that allows an output * speed not faster than the period, and the max output speed.
James Bottomley
maintainerQuoted 5 lines · Roel Kluin
Prevent read from div_10M[-1] when no clock divisor was greater.
Signed-off-by Roel Kluin <[email protected]>---
Can this happen?
No: The low values are only possible for lower periods. 125 is the min period this chip would ever accept (u160) and in order to support that it has to have a master clock at 160MHz.
James