lkml.org 
[lkml]   [2011]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [55/275] PCI: pci-stub: ignore zero-length id parameters
Date
2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Tejun Heo <tj@kernel.org>
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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
drivers/pci/pci-stub.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-2.6.35.y/drivers/pci/pci-stub.c
===================================================================
--- linux-2.6.35.y.orig/drivers/pci/pci-stub.c 2011-03-29 22:51:47.688502940 -0700
+++ linux-2.6.35.y/drivers/pci/pci-stub.c 2011-03-29 23:02:59.304317971 -0700
@@ -54,6 +54,9 @@
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);

\
 
 \ /
  Last update: 2011-03-30 23:09    [W:1.424 / U:0.020 seconds]
©2003-2014 Jasper Spaans. Advertise on this site