[media] sp2: Delete an unnecessary check before the function call "kfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 3 Feb 2015 14:05:26 +0000 (11:05 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 8 Apr 2015 10:36:00 +0000 (07:36 -0300)
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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/sp2.c

index cc1ef966f99f2b6cd937f0b921144bcdcd2ade0a..8fd42767e263da4998d2e3e5676bd258a1d5246c 100644 (file)
@@ -413,11 +413,8 @@ static int sp2_remove(struct i2c_client *client)
        struct sp2 *s = i2c_get_clientdata(client);
 
        dev_dbg(&client->dev, "\n");
-
        sp2_exit(client);
-       if (s != NULL)
-               kfree(s);
-
+       kfree(s);
        return 0;
 }
 
This page took 0.041817 seconds and 5 git commands to generate.