Prevent read from div_10M[-1] when no clock divisor was greater. Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx> --- Can this happen? diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index 297deb8..230add3 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c @@ -542,6 +542,9 @@ sym_getsync(struct sym_hcb *np, u_char dt, u_char sfac, u_char *divp, u_char *fa while (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. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html