mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 15:22:21 -04:00
nvdimm: nfit: 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/20260703144851.80309-1-mdshahid03@gmail.com Signed-off-by: Alison Schofield <alison.schofield@intel.com>
This commit is contained in:
committed by
Alison Schofield
parent
a13c140cc2
commit
61f4eef68f
@@ -1644,8 +1644,7 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user