Skip to content

Commit 9e93540

Browse files
nathanchancenamjaejeon
authored andcommitted
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>
1 parent 4ebcf3f commit 9e93540

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ntfs/runlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ struct runlist_element *ntfs_mapping_pairs_decompress(const struct ntfs_volume *
754754
/* Validate lowest_vcn from on-disk metadata to ensure it is sane. */
755755
if (overflows_type(lowest_vcn, vcn)) {
756756
ntfs_error(vol->sb, "Invalid lowest_vcn in mapping pairs.");
757-
goto err_out;
757+
return ERR_PTR(-EIO);
758758
}
759759
/* Start at vcn = lowest_vcn and lcn 0. */
760760
vcn = lowest_vcn;

0 commit comments

Comments
 (0)