]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.2-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jul 2019 07:20:47 +0000 (09:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jul 2019 07:20:47 +0000 (09:20 +0200)
added patches:
btrfs-shut-up-bogus-wmaybe-uninitialized-warning.patch

queue-5.2/btrfs-shut-up-bogus-wmaybe-uninitialized-warning.patch [new file with mode: 0644]
queue-5.2/series

diff --git a/queue-5.2/btrfs-shut-up-bogus-wmaybe-uninitialized-warning.patch b/queue-5.2/btrfs-shut-up-bogus-wmaybe-uninitialized-warning.patch
new file mode 100644 (file)
index 0000000..3490219
--- /dev/null
@@ -0,0 +1,41 @@
+From 6c64460cdc8be5fa074aa8fe2ae8736d5792bdc5 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 17 Jun 2019 13:07:28 +0200
+Subject: btrfs: shut up bogus -Wmaybe-uninitialized warning
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 6c64460cdc8be5fa074aa8fe2ae8736d5792bdc5 upstream.
+
+gcc sometimes can't determine whether a variable has been initialized
+when both the initialization and the use are conditional:
+
+fs/btrfs/props.c: In function 'inherit_props':
+fs/btrfs/props.c:389:4: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+    btrfs_block_rsv_release(fs_info, trans->block_rsv,
+
+This code is fine. Unfortunately, I cannot think of a good way to
+rephrase it in a way that makes gcc understand this, so I add a bogus
+initialization the way one should not.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Reviewed-by: David Sterba <dsterba@suse.com>
+[ gcc 8 and 9 don't emit the warning ]
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/props.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/props.c
++++ b/fs/btrfs/props.c
+@@ -337,7 +337,7 @@ static int inherit_props(struct btrfs_tr
+       for (i = 0; i < ARRAY_SIZE(prop_handlers); i++) {
+               const struct prop_handler *h = &prop_handlers[i];
+               const char *value;
+-              u64 num_bytes;
++              u64 num_bytes = 0;
+               if (!h->inheritable)
+                       continue;
index 99e1f2112d0e6bf8a7b789864419830a2e41a2fd..bfb9ef4b7276ea9c18d229b91fc0a087a21bec49 100644 (file)
@@ -1,2 +1,3 @@
 regulator-88pm800-fix-warning-same-module-names.patch
 media-drivers-media-coda-fix-warning-same-module-names.patch
+btrfs-shut-up-bogus-wmaybe-uninitialized-warning.patch