This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH] linux: fix PCI resource reservation option parsing

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: fix PCI resource reservation option parsing
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Thu, 25 Mar 2010 09:32:17 +0000
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Thu, 25 Mar 2010 02:35:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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>

--- 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)

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>