[2/3] btrfs: remove superfluous BUG_ON() in integrity checks
diff mbox series

Message ID 20191205131959.19184-3-jth@kernel.org
State New
Headers show
Series
  • Misc fixes silencing false positives from cppcheck
Related show

Commit Message

Johannes Thumshirn Dec. 5, 2019, 1:19 p.m. UTC
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>
---
 fs/btrfs/check-integrity.c | 1 -
 1 file changed, 1 deletion(-)

Patch
diff mbox series

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");