From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751119AbcGNLIu (ORCPT ); Thu, 14 Jul 2016 07:08:50 -0400 Received: from cassarossa.samfundet.no ([193.35.52.29]:58191 "EHLO cassarossa.samfundet.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750916AbcGNLIr (ORCPT ); Thu, 14 Jul 2016 07:08:47 -0400 Date: Thu, 14 Jul 2016 13:08:41 +0200 From: Hans-Christian Noren Egtvedt To: Dan Carpenter Cc: Haavard Skinnemoen , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] avr32: off by one in at32_init_pio() Message-ID: <20160714110841.GA13155@samfundet.no> References: <20160713100855.GE29468@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160713100855.GE29468@mwanda> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Around Wed 13 Jul 2016 13:08:55 +0300 or thereabout, Dan Carpenter wrote: > The pio_dev[] array has MAX_NR_PIO_DEVICES elements so the > should be >>=. So it should, no off by one error in the kernel anyway, since at32ap700x only probes 5 PIO instances. > Fixes: 5f97f7f9400d ('[PATCH] avr32 architecture') > Signed-off-by: Dan Carpenter Acked-by: Hans-Christian Noren Egtvedt I will add this to my linux-next branch for the next merge window. > diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c > index 83c2a00..13d3fc4 100644 > --- a/arch/avr32/mach-at32ap/pio.c > +++ b/arch/avr32/mach-at32ap/pio.c > @@ -435,7 +435,7 @@ void __init at32_init_pio(struct platform_device *pdev) > struct resource *regs; > struct pio_device *pio; > > - if (pdev->id > MAX_NR_PIO_DEVICES) { > + if (pdev->id >= MAX_NR_PIO_DEVICES) { > dev_err(&pdev->dev, "only %d PIO devices supported\n", > MAX_NR_PIO_DEVICES); > return; > -- mvh Hans-Christian Noren Egtvedt