]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
udf: initialize newblock to 0
authorTom Rix <trix@redhat.com>
Fri, 30 Dec 2022 17:53:41 +0000 (12:53 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:53 +0000 (12:22 +0200)
commit529bcc70c49cf96a7aa22f6e35d683d413472a05
tree63814a511a6e329e63a77a43937564597c365eaa
parentfae2d591f3cb31f722c7f065acf586830eab8c2a
udf: initialize newblock to 0

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