mbox series

[0/3] Misc fixes silencing false positives from cppcheck

Message ID 20191205131959.19184-1-jth@kernel.org (mailing list archive)
Headers show
Series Misc fixes silencing false positives from cppcheck | expand

Message

Johannes Thumshirn Dec. 5, 2019, 1:19 p.m. UTC
misc fixes provoked by https://bugzilla.kernel.org/show_bug.cgi?id=205003

The first patch removes an unneeded variable, which when removed silences
a false positive warning generated by cppcheck.

The second patch removes a BUG_ON() which can't be hit, for the same
reasons as there can't be no NULL-pointer dereference in patch 1.

Patch number three removes a WARN_ON() which can't be triggered. This
WARN_ON() was also identified as a possible NULL-pointer dereference by
cppcheck.


Johannes Thumshirn (3):
  btrfs: fix possible NULL-pointer dereference in integrity checks
  btrfs: remove superfluous BUG_ON() in integrity checks
  btrfs: remove impossible WARN_ON in btrfs_destroy_dev_replace_tgtdev()

 fs/btrfs/check-integrity.c | 4 +---
 fs/btrfs/volumes.c         | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

David Sterba Dec. 5, 2019, 1:51 p.m. UTC | #1
On Thu, Dec 05, 2019 at 02:19:56PM +0100, Johannes Thumshirn wrote:
> misc fixes provoked by https://bugzilla.kernel.org/show_bug.cgi?id=205003
> 
> The first patch removes an unneeded variable, which when removed silences
> a false positive warning generated by cppcheck.
> 
> The second patch removes a BUG_ON() which can't be hit, for the same
> reasons as there can't be no NULL-pointer dereference in patch 1.
> 
> Patch number three removes a WARN_ON() which can't be triggered. This
> WARN_ON() was also identified as a possible NULL-pointer dereference by
> cppcheck.
> 
> 
> Johannes Thumshirn (3):
>   btrfs: fix possible NULL-pointer dereference in integrity checks
>   btrfs: remove superfluous BUG_ON() in integrity checks
>   btrfs: remove impossible WARN_ON in btrfs_destroy_dev_replace_tgtdev()

Added to misc-next, thanks.