]> xenbits.xensource.com Git - people/royger/linux-2.6.18-xen.git/commitdiff
pci: fix PCI resource reservation option parsing
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 25 Mar 2010 10:00:03 +0000 (10:00 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 25 Mar 2010 10:00:03 +0000 (10:00 +0000)
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 <jbeulich@novell.com>
drivers/pci/reserve.c

index af299c763641f29e1550c71ecf4b303c066db845..e3cc9aed3b8d5ae19f35070488cd2d00e6f0bd09 100644 (file)
@@ -64,16 +64,11 @@ static int pci_reserve_parse_one(const char *str,
        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)