From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Tejun Heo <tj@kernel.org>
Cc: linux-pci@vger.kernel.org, Chris Wright <chrisw@sous-sol.org>,
Prasad Joshi <P.G.Joshi@student.reading.ac.uk>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
stable@kernel.org
Subject: Re: [PATCH] pci-stub: ignore zero-length id parameters
Date: Thu, 23 Dec 2010 12:54:22 -0800 [thread overview]
Message-ID: <20101223125422.52b13b5a@jbarnes-desktop> (raw)
In-Reply-To: <20101222090635.GB27861@htj.dyndns.org>
On Wed, 22 Dec 2010 10:06:36 +0100
Tejun Heo <tj@kernel.org> wrote:
> pci-stub uses strsep() to separate list of ids and generates a warning
> message when it fails to parse an id. However, not specifying the
> parameter results in ids set to an empty string. strsep() happily
> returns the empty string as the first token and thus triggers the
> warning message spuriously.
>
> Make the tokner ignore zero length ids.
>
> Reported-by: Chris Wright <chrisw@sous-sol.org>
> Reported-by: Prasad Joshi <P.G.Joshi@student.reading.ac.uk>
> Cc: stable@kernel.org
> ---
> drivers/pci/pci-stub.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
> index f7b68ca..4ae494b 100644
> --- a/drivers/pci/pci-stub.c
> +++ b/drivers/pci/pci-stub.c
> @@ -54,6 +54,9 @@ static int __init pci_stub_init(void)
> subdevice = PCI_ANY_ID, class=0, class_mask=0;
> int fields;
>
> + if (!strlen(id))
> + continue;
> +
> fields = sscanf(id, "%x:%x:%x:%x:%x:%x",
> &vendor, &device, &subvendor, &subdevice,
> &class, &class_mask);
>
Applied to my linux-next branch, thanks.
--
Jesse Barnes, Intel Open Source Technology Center
next prev parent reply other threads:[~2010-12-23 20:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-21 16:00 Query on IOMMU Prasad Joshi
2010-12-21 16:15 ` Chris Wright
2010-12-21 16:54 ` Prasad Joshi
2010-12-21 17:12 ` Chris Wright
2010-12-21 17:39 ` Prasad Joshi
2010-12-21 18:33 ` Chris Wright
[not found] ` <000DF292CEBFBB41A633359D615F1514022A5FF4@DB2PRD0103MB011.eurprd01.prod.exchangelabs.com>
2010-12-21 19:22 ` Prasad Joshi
2010-12-21 19:29 ` Chris Wright
2010-12-21 19:56 ` Prasad Joshi
2010-12-21 20:01 ` Chris Wright
2010-12-21 20:06 ` Prasad Joshi
2010-12-22 9:06 ` [PATCH] pci-stub: ignore zero-length id parameters Tejun Heo
2010-12-23 20:54 ` Jesse Barnes [this message]
2010-12-21 20:34 ` Query on IOMMU Chris Wright
2010-12-22 13:16 ` Prasad Joshi
2010-12-22 13:35 ` Prasad Joshi
2010-12-22 14:56 ` Chris Wright
2010-12-22 14:54 ` Chris Wright
2010-12-22 15:02 ` Prasad Joshi
2010-12-22 15:22 ` Chris Wright
2010-12-22 15:46 ` Prasad Joshi
2010-12-22 16:34 ` Prasad Joshi
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=20101223125422.52b13b5a@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=P.G.Joshi@student.reading.ac.uk \
--cc=chrisw@sous-sol.org \
--cc=kvm@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=stable@kernel.org \
--cc=tj@kernel.org \
/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