ASoC: omap-mcbsp: Deletion of an unnecessary check before the function call "kfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 17 Nov 2014 13:05:27 +0000 (14:05 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Nov 2014 23:52:34 +0000 (23:52 +0000)
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>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/omap/mcbsp.c

index 86c75384c3c87dd0e4c9109f737122b1888ad295..68a1252053750a29489382ce6434ed54bd698c96 100644 (file)
@@ -621,8 +621,7 @@ void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
        mcbsp->reg_cache = NULL;
        spin_unlock(&mcbsp->lock);
 
-       if (reg_cache)
-               kfree(reg_cache);
+       kfree(reg_cache);
 }
 
 /*