Skip to content

Commit a34b58b

Browse files
Pavel Machekgregkh
authored andcommitted
btrfs: fix return value mixup in btrfs_get_extent
commit 881a3a1 upstream. btrfs_get_extent() sets variable ret, but out: error path expect error to be in variable err so the error code is lost. Fixes: 6bf9e4b ("btrfs: inode: Verify inode mode to avoid NULL pointer dereference") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 183af2d commit a34b58b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/btrfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7014,7 +7014,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
70147014
found_type == BTRFS_FILE_EXTENT_PREALLOC) {
70157015
/* Only regular file could have regular/prealloc extent */
70167016
if (!S_ISREG(inode->vfs_inode.i_mode)) {
7017-
ret = -EUCLEAN;
7017+
err = -EUCLEAN;
70187018
btrfs_crit(fs_info,
70197019
"regular/prealloc extent found for non-regular inode %llu",
70207020
btrfs_ino(inode));

0 commit comments

Comments
 (0)