xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: xen-devel@lists.xensource.com
Cc: Isaku Yamahata <yamahata@valinux.co.jp>
Subject: [PATCH] linux: fix PCI resource reservation option parsing
Date: Thu, 25 Mar 2010 09:32:17 +0000	[thread overview]
Message-ID: <4BAB3BB10200007800036DDD@vpn.id2.novell.com> (raw)

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>

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

             reply	other threads:[~2010-03-25  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25  9:32 Jan Beulich [this message]
2010-03-25  9:54 ` [PATCH] linux: fix PCI resource reservation option parsing Isaku Yamahata

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BAB3BB10200007800036DDD@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yamahata@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).