mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
nvdimm: ndtest: remove redundant NULL check before vfree()
vfree() safely handles NULL pointers, so the explicit NULL check before calling vfree() is unnecessary. This issue was reported by ifnullfree.cocci. Signed-off-by: Mohammad Shahid <mdshahid03@gmail.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20260703135513.75840-1-mdshahid03@gmail.com Signed-off-by: Alison Schofield <alison.schofield@intel.com>
This commit is contained in:
parent
61f4eef68f
commit
f6b2b1ad96
|
|
@ -376,8 +376,7 @@ 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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user