From: Roel Kluin Date: Wed, 10 Jun 2009 19:52:44 +0000 (-0700) Subject: drivers/isdn/i4l/isdn_tty.c: fix check for array overindexing X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=395df11f5fa7fe852be28ccec8aaa15634386ad1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drivers/isdn/i4l/isdn_tty.c: fix check for array overindexing The check for overindexing of dev->mdm.info[] has an off-by-one. Signed-off-by: Roel Kluin Signed-off-by: Andrew Morton Acked-by: Karsten Keil --- diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 1a2222cbb805..b4d4522e5071 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -1592,7 +1592,7 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp) int retval, line; line = tty->index; - if (line < 0 || line > ISDN_MAX_CHANNELS) + if (line < 0 || line >= ISDN_MAX_CHANNELS) return -ENODEV; info = &dev->mdm.info[line]; if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open"))