]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
coresight: tmc: Delete an unnecessary check before the function call "kfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 25 Aug 2016 21:19:07 +0000 (15:19 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2016 11:05:43 +0000 (13:05 +0200)
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 <elfring@users.sourceforge.net>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-tmc-etf.c

index e68289b8c0721c721a44851d072b7eccde17de81..5fa49c4252f648f49a65959827a4e9f165eac9c2 100644 (file)
@@ -168,7 +168,7 @@ static int tmc_enable_etf_sink_sysfs(struct coresight_device *csdev, u32 mode)
        spin_unlock_irqrestore(&drvdata->spinlock, flags);
 
        /* Free memory outside the spinlock if need be */
-       if (!used && buf)
+       if (!used)
                kfree(buf);
 
        if (!ret)