From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266Ab1G2QFe (ORCPT ); Fri, 29 Jul 2011 12:05:34 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:52822 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174Ab1G2QFd convert rfc822-to-8bit (ORCPT ); Fri, 29 Jul 2011 12:05:33 -0400 MIME-Version: 1.0 Reply-To: axel.lin@gmail.com In-Reply-To: <1309995504.2496.1.camel@phoenix> References: <1309995504.2496.1.camel@phoenix> From: Axel Lin Date: Sat, 30 Jul 2011 00:05:12 +0800 Message-ID: Subject: Re: [PATCH 1/2 RESEND] regulator: aat2870: Fix the logic of checking if no id is matched in aat2870_get_regulator To: linux-kernel@vger.kernel.org Cc: Jin Park , Liam Girdwood , Mark Brown , Samuel Ortiz Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, Seems this 2 patches are not upstream. Should I resend it again? Regards, Axel 2011/7/7 Axel Lin : > In current implementation, the pointer ri is not NULL if no id is matched. > Fix it by checking i == ARRAY_SIZE(aat2870_regulators) if no id is matched. > > Signed-off-by: Axel Lin > Acked-by: Mark Brown > --- >  drivers/regulator/aat2870-regulator.c |    2 +- >  1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c > index cd41045..11d1ab4 100644 > --- a/drivers/regulator/aat2870-regulator.c > +++ b/drivers/regulator/aat2870-regulator.c > @@ -159,7 +159,7 @@ static struct aat2870_regulator *aat2870_get_regulator(int id) >                        break; >        } > > -       if (!ri) > +       if (i == ARRAY_SIZE(aat2870_regulators)) >                return NULL; > >        ri->enable_addr = AAT2870_LDO_EN; > -- > 1.7.4.1 > > > >