summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/check-integrity.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <jth@kernel.org>2019-12-05 14:19:58 +0100
committerDavid Sterba <dsterba@suse.com>2020-01-20 16:40:52 +0100
commit129699522581f465e0300a286ed28a0aab0893d3 (patch)
tree38dca04ea4b4072695e79096d1454e678936a766 /fs/btrfs/check-integrity.c
parentbtrfs: fix possible NULL-pointer dereference in integrity checks (diff)
downloadlinux-129699522581f465e0300a286ed28a0aab0893d3.tar.xz
linux-129699522581f465e0300a286ed28a0aab0893d3.zip
btrfs: remove superfluous BUG_ON() in integrity checks
btrfsic_process_superblock() BUG_ON()s if 'state' is NULL. But this can never happen as the only caller from btrfsic_process_superblock() is btrfsic_mount() which allocates 'state' some lines above calling btrfsic_process_superblock() and checks for the allocation to succeed. Let's just remove the impossible to hit BUG_ON(). Signed-off-by: Johannes Thumshirn <jth@kernel.org> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/check-integrity.c')
-rw-r--r--fs/btrfs/check-integrity.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index 72c70f59fc60..a0ce69f2d27c 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -636,7 +636,6 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
int ret = 0;
int pass;
- BUG_ON(NULL == state);
selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS);
if (NULL == selected_super) {
pr_info("btrfsic: error, kmalloc failed!\n");