[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210626020613.517758-1-13145886936@163.com>
Date: Fri, 25 Jun 2021 19:06:13 -0700
From: 13145886936@....com
To: dan.j.williams@...el.com, vishal.l.verma@...el.com,
dave.jiang@...el.com, ira.weiny@...el.com
Cc: nvdimm@...ts.linux.dev, linux-kernel@...r.kernel.org,
gushengxian <gushengxian@...ong.com>,
gushengxian <13145886936@....com>
Subject: [PATCH] ndtest: Remove NULL test before vfree
From: gushengxian <gushengxian@...ong.com>
This NULL test is redundant since vfree() checks for NULL.
Reported by Coccinelle.
Signed-off-by: gushengxian <13145886936@....com>
Signed-off-by: gushengxian <gushengxian@...ong.com>
---
tools/testing/nvdimm/test/ndtest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/nvdimm/test/ndtest.c b/tools/testing/nvdimm/test/ndtest.c
index 6862915f1fb0..b1025c08ba92 100644
--- a/tools/testing/nvdimm/test/ndtest.c
+++ b/tools/testing/nvdimm/test/ndtest.c
@@ -487,8 +487,8 @@ static void *ndtest_alloc_resource(struct ndtest_priv *p, size_t size,
buf_err:
if (__dma && size >= DIMM_SIZE)
gen_pool_free(ndtest_pool, __dma, size);
- if (buf)
- vfree(buf);
+
+ vfree(buf);
kfree(res);
return NULL;
--
2.25.1
Powered by blists - more mailing lists