From: Greg Kroah-Hartman Date: Tue, 12 Sep 2023 12:06:39 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v6.1.53~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73bd4aabaaf28c62d49f315d57bc58a9276062c4;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: udf-initialize-newblock-to-0.patch --- diff --git a/queue-6.1/series b/queue-6.1/series index 90193a505f9..cd4285c62ee 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -591,3 +591,4 @@ md-fix-regression-for-null-ptr-deference-in-__md_stop.patch clk-mark-a-fwnode-as-initialized-when-using-clk_of_declare-macro.patch treewide-fix-probing-of-devices-in-dt-overlays.patch clk-avoid-invalid-function-names-in-clk_of_declare.patch +udf-initialize-newblock-to-0.patch diff --git a/queue-6.1/udf-initialize-newblock-to-0.patch b/queue-6.1/udf-initialize-newblock-to-0.patch new file mode 100644 index 00000000000..cbff2b2d120 --- /dev/null +++ b/queue-6.1/udf-initialize-newblock-to-0.patch @@ -0,0 +1,53 @@ +From 23970a1c9475b305770fd37bebfec7a10f263787 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Fri, 30 Dec 2022 12:53:41 -0500 +Subject: udf: initialize newblock to 0 + +From: Tom Rix + +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 +Signed-off-by: Tom Rix +Signed-off-by: Jan Kara +Message-Id: <20221230175341.1629734-1-trix@redhat.com> +Signed-off-by: Greg Kroah-Hartman +--- + fs/udf/inode.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/fs/udf/inode.c ++++ b/fs/udf/inode.c +@@ -696,7 +696,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); +@@ -799,7 +799,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; +@@ -862,7 +861,6 @@ static sector_t inode_getblk(struct inod + goal, err); + if (!newblocknum) { + *err = -ENOSPC; +- newblock = 0; + goto out_free; + } + if (isBeyondEOF)