summaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/01-usb-devices-use-local-variable-type-to-handle-recurs.patch39
-rw-r--r--debian/patches/series1
2 files changed, 40 insertions, 0 deletions
diff --git a/debian/patches/01-usb-devices-use-local-variable-type-to-handle-recurs.patch b/debian/patches/01-usb-devices-use-local-variable-type-to-handle-recurs.patch
new file mode 100644
index 0000000..c8c9314
--- /dev/null
+++ b/debian/patches/01-usb-devices-use-local-variable-type-to-handle-recurs.patch
@@ -0,0 +1,39 @@
+From b1c31712134d2b28877bbe01de1526a256ca676c Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Fri, 15 Oct 2021 16:07:17 +0200
+Subject: [PATCH] usb-devices: use 'local' variable type to handle recursion
+
+When recursing into a long USB tree, the local variables in the
+print_device() function would get confused and take on the value of the
+previous device it printed. This caused devices to not get printed out
+at all, the exact opposite of what we wanted.
+
+Resolve this by using the non-POSIX 'local' variable declaration.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ usb-devices | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/usb-devices b/usb-devices
+index 4e14608..9aca88d 100755
+--- a/usb-devices
++++ b/usb-devices
+@@ -101,10 +101,10 @@ print_interface() {
+ }
+
+ print_device() {
+- devpath=$1
+- parent=$2
+- level=$3
+- count=$4
++ local devpath=$1
++ local parent=$2
++ local level=$3
++ local count=$4
+
+ [ -d $devpath ] || return
+ cd $devpath
+--
+2.42.0
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..f7f6fa3
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01-usb-devices-use-local-variable-type-to-handle-recurs.patch