aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Li <[email protected]>2021-01-21 16:19:47 +0800
committerDavid Sterba <[email protected]>2021-02-08 22:58:52 +0100
commitfe3b7bb085a0b1fb26d622a5eccc7dbb5c4f82fb (patch)
tree9025e18f08e20eda54134066ffa7dc8ee926c749
parent7e2a870a599d4699a626ec26430c7a1ab14a2a49 (diff)
btrfs: remove redundant NULL check before kvfree
Fix below warnings reported by coccicheck: ./fs/btrfs/raid56.c:237:2-8: WARNING: NULL check before some freeing functions is not needed. Reported-by: Abaci Robot <[email protected]> Reviewed-by: Anand Jain <[email protected]> Signed-off-by: Yang Li <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
-rw-r--r--fs/btrfs/raid56.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 93fbf87bdc8d..5394641541f7 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -233,8 +233,7 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)
}
x = cmpxchg(&info->stripe_hash_table, NULL, table);
- if (x)
- kvfree(x);
+ kvfree(x);
return 0;
}