summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-01-26 05:40:02 +0300
committerMike Snitzer <snitzer@redhat.com>2021-02-03 18:10:05 +0300
commit21ec672ecf18dd80e58936b0687da9098913c810 (patch)
tree2b392798e4c1e64cf88022caf9dc061b10c8c847 /drivers/md
parentcb728484a7710c202f02b96aa0962ce9b07aa5c2 (diff)
downloadlinux-21ec672ecf18dd80e58936b0687da9098913c810.tar.xz
dm writecache: fix unnecessary NULL check warnings
Remove NULL checks before vfree() to fix these warnings: ./drivers/md/dm-writecache.c:2008:2-7: WARNING: NULL check before some freeing functions is not needed. ./drivers/md/dm-writecache.c:2024:2-7: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-writecache.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 1769653c3d6b..fd531d5a39c2 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -2004,8 +2004,7 @@ static void writecache_dtr(struct dm_target *ti)
if (wc->ssd_dev)
dm_put_device(ti, wc->ssd_dev);
- if (wc->entries)
- vfree(wc->entries);
+ vfree(wc->entries);
if (wc->memory_map) {
if (WC_MODE_PMEM(wc))
@@ -2020,8 +2019,7 @@ static void writecache_dtr(struct dm_target *ti)
if (wc->dm_io)
dm_io_client_destroy(wc->dm_io);
- if (wc->dirty_bitmap)
- vfree(wc->dirty_bitmap);
+ vfree(wc->dirty_bitmap);
kfree(wc);
}