]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
btrfs: fix lost return value due to variable shadowing
authorDavid Sterba <dsterba@suse.cz>
Tue, 24 Feb 2015 17:57:18 +0000 (18:57 +0100)
committerChris Mason <clm@fb.com>
Mon, 2 Mar 2015 22:04:45 +0000 (14:04 -0800)
A block-local variable stores error code but btrfs_get_blocks_direct may
not return it in the end as there's a ret defined in the function scope.

CC: <stable@vger.kernel.org> # 3.6+
Fixes: d187663ef24c ("Btrfs: lock extents as we map them in DIO")
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/inode.c

index 8564d8ce03de6860745a03dd12cf13062f3b63e4..91a87f53be3c1d1498430d2ace956cfe6dcc737b 100644 (file)
@@ -7288,7 +7288,6 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
            ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) &&
             em->block_start != EXTENT_MAP_HOLE)) {
                int type;
-               int ret;
                u64 block_start, orig_start, orig_block_len, ram_bytes;
 
                if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags))