]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Sep 2023 12:06:19 +0000 (14:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Sep 2023 12:06:19 +0000 (14:06 +0200)
added patches:
udf-initialize-newblock-to-0.patch

queue-5.4/series
queue-5.4/udf-initialize-newblock-to-0.patch [new file with mode: 0644]

index 538609414ca7e1dc8c0d1e0444fa00d256cff438..52d42efa00616d6b3a22d705723860b95e365fcd 100644 (file)
@@ -237,3 +237,4 @@ cpufreq-brcmstb-avs-cpufreq-fix-warray-bounds-bug.patch
 sc16is7xx-set-iobase-to-device-index.patch
 serial-sc16is7xx-fix-broken-port-0-uart-init.patch
 usb-typec-tcpci-clear-the-fault-status-bit.patch
+udf-initialize-newblock-to-0.patch
diff --git a/queue-5.4/udf-initialize-newblock-to-0.patch b/queue-5.4/udf-initialize-newblock-to-0.patch
new file mode 100644 (file)
index 0000000..7cf291a
--- /dev/null
@@ -0,0 +1,53 @@
+From 23970a1c9475b305770fd37bebfec7a10f263787 Mon Sep 17 00:00:00 2001
+From: Tom Rix <trix@redhat.com>
+Date: Fri, 30 Dec 2022 12:53:41 -0500
+Subject: udf: initialize newblock to 0
+
+From: Tom Rix <trix@redhat.com>
+
+commit 23970a1c9475b305770fd37bebfec7a10f263787 upstream.
+
+The clang build reports this error
+fs/udf/inode.c:805:6: error: variable 'newblock' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
+        if (*err < 0)
+            ^~~~~~~~
+newblock is never set before error handling jump.
+Initialize newblock to 0 and remove redundant settings.
+
+Fixes: d8b39db5fab8 ("udf: Handle error when adding extent to a file")
+Reported-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Tom Rix <trix@redhat.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Message-Id: <20221230175341.1629734-1-trix@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/udf/inode.c |    4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/fs/udf/inode.c
++++ b/fs/udf/inode.c
+@@ -698,7 +698,7 @@ static sector_t inode_getblk(struct inod
+       struct kernel_lb_addr eloc, tmpeloc;
+       int c = 1;
+       loff_t lbcount = 0, b_off = 0;
+-      udf_pblk_t newblocknum, newblock;
++      udf_pblk_t newblocknum, newblock = 0;
+       sector_t offset = 0;
+       int8_t etype;
+       struct udf_inode_info *iinfo = UDF_I(inode);
+@@ -801,7 +801,6 @@ static sector_t inode_getblk(struct inod
+               ret = udf_do_extend_file(inode, &prev_epos, laarr, hole_len);
+               if (ret < 0) {
+                       *err = ret;
+-                      newblock = 0;
+                       goto out_free;
+               }
+               c = 0;
+@@ -864,7 +863,6 @@ static sector_t inode_getblk(struct inod
+                               goal, err);
+               if (!newblocknum) {
+                       *err = -ENOSPC;
+-                      newblock = 0;
+                       goto out_free;
+               }
+               if (isBeyondEOF)