Commit 977ec792 authored by Fabian Frederick's avatar Fabian Frederick Committed by David Sterba

btrfs: kmap() can't fail

Remove NULL test on kmap() as it will always return a valid pointer.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 41f1830f
...@@ -1668,14 +1668,8 @@ static int btrfsic_read_block(struct btrfsic_state *state, ...@@ -1668,14 +1668,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
dev_bytenr += (j - i) * PAGE_SIZE; dev_bytenr += (j - i) * PAGE_SIZE;
i = j; i = j;
} }
for (i = 0; i < num_pages; i++) { for (i = 0; i < num_pages; i++)
block_ctx->datav[i] = kmap(block_ctx->pagev[i]); block_ctx->datav[i] = kmap(block_ctx->pagev[i]);
if (!block_ctx->datav[i]) {
pr_info("btrfsic: kmap() failed (dev %s)!\n",
block_ctx->dev->name);
return -1;
}
}
return block_ctx->len; return block_ctx->len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment