[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] pci: fix PCI resource reservation option parsing



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1269511203 0
# Node ID 10eae161c15390fdf31cd210b36540d608c46801
# Parent  ca0b8d76d649756156fbe5d471dfbae266b4f7be
pci: fix PCI resource reservation option parsing

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@xxxxxxxxxx>
---
 drivers/pci/reserve.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff -r ca0b8d76d649 -r 10eae161c153 drivers/pci/reserve.c
--- a/drivers/pci/reserve.c     Thu Mar 25 09:59:38 2010 +0000
+++ b/drivers/pci/reserve.c     Thu Mar 25 10:00:03 2010 +0000
@@ -64,16 +64,11 @@ static int pci_reserve_parse_one(const c
        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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.