btrfs: fix return value mixup in btrfs_get_extent
commit8c143122137487e3456e662bb1cd44f8b6236622
authorPavel Machek <pavel@denx.de>
Mon, 3 Aug 2020 09:35:06 +0000 (3 11:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:05:23 +0000 (21 13:05 +0200)
tree32fe3cac04fc220e2e31794f115841231272c0bb
parentd256992d5105d9d9882f9815a32ff181205e83ff
btrfs: fix return value mixup in btrfs_get_extent

commit 881a3a11c2b858fe9b69ef79ac5ee9978a266dc9 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: 6bf9e4bd6a27 ("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>
fs/btrfs/inode.c