[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55958AD3.5070507@users.sourceforge.net>
Date: Thu, 02 Jul 2015 21:02:43 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Dan Williams <dan.j.williams@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
CC: kernel-janitors <kernel-janitors@...r.kernel.org>,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 1/2] tools/testing/nvdimm: Delete an unnecessary check before
the function call "vfree"
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 2 Jul 2015 19:24:27 +0200
The vfree() function performs also input parameter validation.
Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
tools/testing/nvdimm/test/nfit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 4b69b83..9c910f1 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -270,7 +270,7 @@ static void *__test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma,
err:
if (buf && !is_vmalloc_addr(buf))
dma_free_coherent(dev, size, buf, *dma);
- else if (buf)
+ else
vfree(buf);
kfree(res);
kfree(nfit_res);
--
2.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists