From: Hyunchul Lee <hyc.lee@gmail.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Namjae Jeon <linkinjeon@kernel.org>,
Zhan Xusheng <zhanxusheng@xiaomi.com>,
linux-fsdevel@vger.kernel.org, llvm@lists.linux.dev,
patches@lists.linux.dev
Subject: Re: [PATCH] ntfs: Use return instead of goto in ntfs_mapping_pairs_decompress()
Date: Wed, 29 Apr 2026 08:25:26 +0900 [thread overview]
Message-ID: <afFB5jP8Wer3MYRp@hyunchul-PC02> (raw)
In-Reply-To: <20260428-ntfs-fix-sometimes-uninit-rl-v1-1-31e0c8025430@kernel.org>
On Tue, Apr 28, 2026 at 03:21:38PM -0400, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y / W=e):
>
> fs/ntfs/runlist.c:755:6: error: variable 'rl' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
> 755 | if (overflows_type(lowest_vcn, vcn)) {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ...
> fs/ntfs/runlist.c:971:9: note: uninitialized use occurs here
> 971 | kvfree(rl);
> | ^~
> ...
>
> rl has not been allocated at this point so the 'goto err_out' should
> really just be a return of the error pointer -EIO.
>
> Fixes: cad7c6f0a514 ("ntfs: fix VCN overflow in ntfs_mapping_pairs_decompress()")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Thank you for this patch.
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
> ---
> fs/ntfs/runlist.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ntfs/runlist.c b/fs/ntfs/runlist.c
> index be6ca3d374bb..da21dbeaaf66 100644
> --- a/fs/ntfs/runlist.c
> +++ b/fs/ntfs/runlist.c
> @@ -754,7 +754,7 @@ struct runlist_element *ntfs_mapping_pairs_decompress(const struct ntfs_volume *
> /* Validate lowest_vcn from on-disk metadata to ensure it is sane. */
> if (overflows_type(lowest_vcn, vcn)) {
> ntfs_error(vol->sb, "Invalid lowest_vcn in mapping pairs.");
> - goto err_out;
> + return ERR_PTR(-EIO);
> }
> /* Start at vcn = lowest_vcn and lcn 0. */
> vcn = lowest_vcn;
>
> ---
> base-commit: d986ba0329dcca102e227995371135c9bbcefb6b
> change-id: 20260428-ntfs-fix-sometimes-uninit-rl-cfe3c6a9c34e
>
> Best regards,
> --
> Nathan Chancellor <nathan@kernel.org>
>
--
Thanks,
Hyunchul
next prev parent reply other threads:[~2026-04-28 23:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 19:21 [PATCH] ntfs: Use return instead of goto in ntfs_mapping_pairs_decompress() Nathan Chancellor
2026-04-28 23:25 ` Hyunchul Lee [this message]
2026-04-29 22:07 ` Namjae Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afFB5jP8Wer3MYRp@hyunchul-PC02 \
--to=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=patches@lists.linux.dev \
--cc=zhanxusheng@xiaomi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox