summaryrefslogtreecommitdiff
path: root/drivers/pci/pci-stub.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-12-22 09:06:36 (GMT)
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-12-23 20:53:52 (GMT)
commit99a0fadf561e1f553c08f0a29f8b2578f55dd5f0 (patch)
tree97bf80533001e4aedf6e6e96e21c3cac4bd37641 /drivers/pci/pci-stub.c
parent9b444b36fee16d2aaae9cc91ce594ecb15d922a9 (diff)
downloadlinux-99a0fadf561e1f553c08f0a29f8b2578f55dd5f0.tar.xz
PCI: pci-stub: ignore zero-length id parameters
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 Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-stub.c')
-rw-r--r--drivers/pci/pci-stub.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
index 4c0336b..775e933 100644
--- a/drivers/pci/pci-stub.c
+++ b/drivers/pci/pci-stub.c
@@ -58,6 +58,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);