[usbutils/f17] lsusb-t: make sure that interfaces are added to lists only once (#914929)
Lukáš Nykrýn
lnykryn at fedoraproject.org
Tue Feb 26 14:12:50 UTC 2013
commit 09332facccccca86c5cd25e899d4f5c23f0ce827
Author: Lukas Nykryn <lnykryn at redhat.com>
Date: Tue Feb 26 15:03:01 2013 +0100
lsusb-t: make sure that interfaces are added to lists only once (#914929)
Conflicts:
usbutils.spec
usbutils-006-lsub-t_loop.patch | 34 ++++++++++++++++++++++++++++++++++
usbutils.spec | 7 ++++++-
2 files changed, 40 insertions(+), 1 deletions(-)
---
diff --git a/usbutils-006-lsub-t_loop.patch b/usbutils-006-lsub-t_loop.patch
new file mode 100644
index 0000000..733449c
--- /dev/null
+++ b/usbutils-006-lsub-t_loop.patch
@@ -0,0 +1,34 @@
+diff --git a/lsusb-t.c b/lsusb-t.c
+index 074dafb..3e29072 100644
+--- a/lsusb-t.c
++++ b/lsusb-t.c
+@@ -210,8 +210,13 @@ static void read_sysfs_file_string(const char *d_name, const char *file, char *b
+
+ static void append_dev_interface(struct usbinterface *i, struct usbinterface *new)
+ {
+- while (i->next)
++ while (i->next) {
++ if (i == new)
++ return;
+ i = i->next;
++ }
++ if (i == new)
++ return;
+ i->next = new;
+ }
+
+@@ -230,8 +235,13 @@ static void append_businterface(unsigned int busnum, struct usbinterface *new)
+ if (b->busnum == busnum) {
+ i = b->first_interface;
+ if (i) {
+- while (i->next)
++ while (i->next) {
++ if (i == new)
++ return;
+ i = i->next;
++ }
++ if (i == new)
++ return;
+ i->next = new;
+ } else
+ b->first_interface = new;
diff --git a/usbutils.spec b/usbutils.spec
index 8927d3c..be7e81a 100644
--- a/usbutils.spec
+++ b/usbutils.spec
@@ -1,6 +1,6 @@
Name: usbutils
Version: 004
-Release: 4%{?dist}
+Release: 5%{?dist}
Source: http://www.kernel.org/pub/linux/utils/usb/usbutils/%{name}-%{version}.tar.gz
URL: http://www.linux-usb.org/
License: GPLv2+
@@ -15,6 +15,7 @@ Patch0: usbutils-003-hwdata.patch
#Path to usb.ids should be with /hwdata/
Patch1: usbutils-make-hwdata.patch
Patch2: usbutils-005-readlink.patch
+Patch3: usbutils-006-lsub-t_loop.patch
%description
This package contains utilities for inspecting devices connected to a
@@ -25,6 +26,7 @@ USB bus.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
autoreconf
%build
@@ -46,6 +48,9 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm -rf $RPM_BUILD_ROOT
%changelog
+* Tue Feb 26 2013 Lukáš Nykrýn <lnykryn at redhat.com> - 004-5
+- lsusb-t: make sure that interfaces are added to lists only once (#814087)
+
* Thu Apr 19 2012 Lukas Nykryn <lnykryn at redhat.com> 004-4
- Ignore missing driver symlink (#808934)
More information about the scm-commits
mailing list