summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch
blob: 2c2d2ea0b13c8c661f9ad12b14b047769d633e64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
When squashfs support is enabled, the build fails with:

../grub-2.02/grub-core/fs/squash4.c: In function 'direct_read':
../grub-2.02/grub-core/fs/squash4.c:868:10: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       if (err)
          ^
cc1: all warnings being treated as errors
Makefile:7272: recipe for target 'grub-core/fs/libgrubmods_a-squash4.o' failed

Upstream-Status: Pending (should be fixed in gnulib which is then rarely updated in grub)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

--- grub-2.02/grub-core/fs/squash4.c	2019-03-10 20:00:14.070468728 +0000
+++ grub-2.02.fixed/grub-core/fs/squash4.c	2019-03-10 19:58:31.382477818 +0000
@@ -746,7 +746,7 @@
 	     struct grub_squash_cache_inode *ino,
 	     grub_off_t off, char *buf, grub_size_t len)
 {
-  grub_err_t err;
+  grub_err_t err = 0;
   grub_off_t cumulated_uncompressed_size = 0;
   grub_uint64_t a = 0;
   grub_size_t i;