PCI: pci-stub: ignore zero-length id parameters
authorTejun Heo <tj@kernel.org>
Wed, 22 Dec 2010 09:06:36 +0000 (10:06 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:14:24 +0000 (15:14 -0800)
commit69e992c52083d7753ce7aa0a5815a55fb1c847d5
tree7a09e735e84fc3536a7e239d506d7576f4ce3d72
parent3033aa7eb6f36ffa6d16ae643b1b1002cabfa764
PCI: pci-stub: ignore zero-length id parameters

commit 99a0fadf561e1f553c08f0a29f8b2578f55dd5f0 upstream.

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>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pci-stub.c