summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch')
-rw-r--r--meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch b/meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch
new file mode 100644
index 0000000000..217a775609
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch
@@ -0,0 +1,36 @@
1From 6cef7f6079550af3bf91dbff824398eaef08c3c5 Mon Sep 17 00:00:00 2001
2From: Andrei Borzenkov <arvidjaar@gmail.com>
3Date: Tue, 4 Apr 2017 19:22:32 +0300
4Subject: [PATCH 1/4] btrfs: avoid "used uninitialized" error with GCC7
5
6sblock was local and so considered new variable on every loop
7iteration.
8
9Closes: 50597
10---
11Upstream-Status: Backport
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13
14 grub-core/fs/btrfs.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
18index 9cffa91..4849c1c 100644
19--- a/grub-core/fs/btrfs.c
20+++ b/grub-core/fs/btrfs.c
21@@ -227,11 +227,11 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data,
22 static grub_err_t
23 read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb)
24 {
25+ struct grub_btrfs_superblock sblock;
26 unsigned i;
27 grub_err_t err = GRUB_ERR_NONE;
28 for (i = 0; i < ARRAY_SIZE (superblock_sectors); i++)
29 {
30- struct grub_btrfs_superblock sblock;
31 /* Don't try additional superblocks beyond device size. */
32 if (i && (grub_le_to_cpu64 (sblock.this_device.size)
33 >> GRUB_DISK_SECTOR_BITS) <= superblock_sectors[i])
34--
351.9.1
36