From: Markus Elfring Date: Sat, 23 Jul 2016 18:04:09 +0000 (+0200) Subject: coresight: tmc: Delete an unnecessary check before the function call "kfree" X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=b761aefff4dbf6628571c203427ab862f2184900;p=deliverable%2Flinux.git coresight: tmc: Delete an unnecessary check before the function call "kfree" The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Mathieu Poirier --- diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index e68289b8c072..5fa49c4252f6 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -168,7 +168,7 @@ out: spin_unlock_irqrestore(&drvdata->spinlock, flags); /* Free memory outside the spinlock if need be */ - if (!used && buf) + if (!used) kfree(buf); if (!ret)