]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.7.7/avr32-off-by-one-in-at32_init_pio.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.7.7 / avr32-off-by-one-in-at32_init_pio.patch
1 From 55f1cf83d5cf885c75267269729805852039c834 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Wed, 13 Jul 2016 13:08:55 +0300
4 Subject: avr32: off by one in at32_init_pio()
5
6 From: Dan Carpenter <dan.carpenter@oracle.com>
7
8 commit 55f1cf83d5cf885c75267269729805852039c834 upstream.
9
10 The pio_dev[] array has MAX_NR_PIO_DEVICES elements so the > should be
11 >=.
12
13 Fixes: 5f97f7f9400d ('[PATCH] avr32 architecture')
14 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16
17 ---
18 arch/avr32/mach-at32ap/pio.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 --- a/arch/avr32/mach-at32ap/pio.c
22 +++ b/arch/avr32/mach-at32ap/pio.c
23 @@ -435,7 +435,7 @@ void __init at32_init_pio(struct platfor
24 struct resource *regs;
25 struct pio_device *pio;
26
27 - if (pdev->id > MAX_NR_PIO_DEVICES) {
28 + if (pdev->id >= MAX_NR_PIO_DEVICES) {
29 dev_err(&pdev->dev, "only %d PIO devices supported\n",
30 MAX_NR_PIO_DEVICES);
31 return;