From: Johannes Thumshirn <jth@kernel.org>
To: David Sterba <dsterba@suse.com>
Cc: Linux BTRFS Mailinglist <linux-btrfs@vger.kernel.org>,
Johannes Thumshirn <jth@kernel.org>
Subject: [PATCH 2/3] btrfs: remove superfluous BUG_ON() in integrity checks
Date: Thu, 5 Dec 2019 14:19:58 +0100 [thread overview]
Message-ID: <20191205131959.19184-3-jth@kernel.org> (raw)
In-Reply-To: <20191205131959.19184-1-jth@kernel.org>
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(-)
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");
--
2.21.0 (Apple Git-122)
next prev parent reply other threads:[~2019-12-05 13:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 13:19 [PATCH 0/3] Misc fixes silencing false positives from cppcheck Johannes Thumshirn
2019-12-05 13:19 ` [PATCH 1/3] btrfs: fix possible NULL-pointer dereference in integrity checks Johannes Thumshirn
2019-12-05 13:19 ` Johannes Thumshirn [this message]
2019-12-05 13:19 ` [PATCH 3/3] btrfs: remove impossible WARN_ON in btrfs_destroy_dev_replace_tgtdev() Johannes Thumshirn
2019-12-05 13:51 ` [PATCH 0/3] Misc fixes silencing false positives from cppcheck David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191205131959.19184-3-jth@kernel.org \
--to=jth@kernel.org \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.