]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Aug 2017 07:14:09 +0000 (09:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Aug 2017 07:14:09 +0000 (09:14 +0200)
added patches:
lz4-fix-bogus-gcc-warning.patch

queue-4.9/lz4-fix-bogus-gcc-warning.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/lz4-fix-bogus-gcc-warning.patch b/queue-4.9/lz4-fix-bogus-gcc-warning.patch
new file mode 100644 (file)
index 0000000..446501f
--- /dev/null
@@ -0,0 +1,48 @@
+From foo@baz Thu Aug 31 09:09:54 CEST 2017
+Date: Thu, 31 Aug 2017 09:09:54 +0200
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: lz4: fix bogus gcc warning
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+When building lz4 under gcc-7 we get the following bogus warning:
+
+  CC [M]  lib/lz4/lz4hc_compress.o
+lib/lz4/lz4hc_compress.c: In function ‘lz4hc_compress’:
+lib/lz4/lz4hc_compress.c:179:42: warning: ‘delta’ may be used uninitialized in this function [-Wmaybe-uninitialized]
+    chaintable[(size_t)(ptr) & MAXD_MASK] = delta;
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
+lib/lz4/lz4hc_compress.c:134:6: note: ‘delta’ was declared here
+  u16 delta;
+      ^~~~~
+
+This doesn't show up in the 4.4-stable tree due to us turning off
+warnings like this.  It also doesn't show up in newer kernel versions as
+this code was totally rewritten.
+
+So for now, to get the 4.9-stable tree to build with 0 warnings on x86
+allmodconfig, let's just shut the compiler up by initializing the
+variable to 0, despite it not really doing anything.
+
+To be far, this code is crazy complex, so the fact that gcc can't
+determine if the variable is really used or not isn't that bad, I'd
+blame the code here instead of the compiler.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/lz4/lz4hc_compress.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/lz4/lz4hc_compress.c
++++ b/lib/lz4/lz4hc_compress.c
+@@ -131,7 +131,7 @@ static inline int lz4hc_insertandfindbes
+ #endif
+       int nbattempts = MAX_NB_ATTEMPTS;
+       size_t repl = 0, ml = 0;
+-      u16 delta;
++      u16 delta = 0;
+       /* HC4 match finder */
+       lz4hc_insert(hc4, ip);
index 7f1c743271a5e863f1dd334642b3698fecc5291a..eef2fa70d481de65a3a45767392f39f2bfda24ee 100644 (file)
@@ -9,3 +9,4 @@ arm64-fpsimd-prevent-registers-leaking-across-exec.patch
 locking-spinlock-debug-remove-spinlock-lockup-detection-code.patch
 scsi-sg-protect-accesses-to-reserved-page-array.patch
 scsi-sg-reset-res_in_use-after-unlinking-reserved-array.patch
+lz4-fix-bogus-gcc-warning.patch