From: Tejun Heo Date: Wed, 22 Dec 2010 09:06:36 +0000 (+0100) Subject: PCI: pci-stub: ignore zero-length id parameters X-Git-Tag: v3.0~2083^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99a0fadf561e1f553c08f0a29f8b2578f55dd5f0;p=platform%2Fkernel%2Flinux-amlogic.git 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 Reported-by: Prasad Joshi Cc: stable@kernel.org Signed-off-by: Jesse Barnes --- 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);