Commit c5e3c19b authored by Tom Rix's avatar Tom Rix Committed by sanglipeng
Browse files

udf: initialize newblock to 0

stable inclusion
from stable-v5.10.195
commit 26f9ccb7a043ba203a534ed234e47841abe8ac9f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I95JOC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=26f9ccb7a043ba203a534ed234e47841abe8ac9f



--------------------------------

commit 23970a1c 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: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20221230175341.1629734-1-trix@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 4a9428e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment