Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ntfs: Use return instead of goto in ntfs_mapping_pairs_decompress()

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.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>

authored by

Nathan Chancellor and committed by
Namjae Jeon
9e935407 4ebcf3f9

+1 -1
+1 -1
fs/ntfs/runlist.c
··· 754 754 /* Validate lowest_vcn from on-disk metadata to ensure it is sane. */ 755 755 if (overflows_type(lowest_vcn, vcn)) { 756 756 ntfs_error(vol->sb, "Invalid lowest_vcn in mapping pairs."); 757 - goto err_out; 757 + return ERR_PTR(-EIO); 758 758 } 759 759 /* Start at vcn = lowest_vcn and lcn 0. */ 760 760 vcn = lowest_vcn;