lkml.org 
[lkml]   [2021]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tools/testing/nvdimm: NULL check before vfree() is not needed
Date
From: gushengxian <gushengxian@yulong.com>

NULL check before vfree() is not needed.

Signed-off-by: gushengxian <gushengxian@yulong.com>
---
tools/testing/nvdimm/test/nfit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 54f367cbadae..cb86f0cbb11c 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -1641,8 +1641,8 @@ static void *__test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma,
err:
if (*dma && size >= DIMM_SIZE)
gen_pool_free(nfit_pool, *dma, size);
- if (buf)
- vfree(buf);
+
+ vfree(buf);
kfree(nfit_res);
return NULL;
}
--
2.25.1
\
 
 \ /
  Last update: 2021-06-25 09:29    [W:0.028 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site