mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-12 16:40:42 +09:00
PCI: pci-stub: ignore zero-length id parameters
commit 99a0fadf56 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6399e7b53f
commit
4ff49d83ac
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user