From mboxrd@z Thu Jan 1 00:00:00 1970 From: Isaku Yamahata Subject: Re: [PATCH] linux: fix PCI resource reservation option parsing Date: Thu, 25 Mar 2010 18:54:11 +0900 Message-ID: <20100325095411.GC15718@valinux.co.jp> References: <4BAB3BB10200007800036DDD@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <4BAB3BB10200007800036DDD@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Looks good. Thank you. Acked-by: Isaku Yamahata On Thu, Mar 25, 2010 at 09:32:17AM +0000, Jan Beulich wrote: > Start looking for the second '+' after the first one (rather than at > the beginning again). Also fail if second string cannot be parsed. > > Signed-off-by: Jan Beulich > > --- a/drivers/pci/reserve.c > +++ b/drivers/pci/reserve.c > @@ -60,16 +60,11 @@ static int pci_reserve_parse_one( > p = strchr(str, '+'); > if (p == NULL) > return -EINVAL; > - p++; > - if (pci_reserve_parse_size(p, io_size, mem_size)) > + if (pci_reserve_parse_size(++p, io_size, mem_size)) > return -EINVAL; > > - p = strchr(str, '+'); > - if (p != NULL) { > - p++; > - pci_reserve_parse_size(p, io_size, mem_size); > - } > - return 0; > + p = strchr(p, '+'); > + return p ? pci_reserve_parse_size(p + 1, io_size, mem_size) : 0; > } > > static unsigned long pci_reserve_size(struct pci_bus *pbus, int flags) > > > -- yamahata