Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] sp2: 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 <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Markus Elfring and committed by
Mauro Carvalho Chehab
0ea4bce7 275350a0

+1 -4
+1 -4
drivers/media/dvb-frontends/sp2.c
··· 413 413 struct sp2 *s = i2c_get_clientdata(client); 414 414 415 415 dev_dbg(&client->dev, "\n"); 416 - 417 416 sp2_exit(client); 418 - if (s != NULL) 419 - kfree(s); 420 - 417 + kfree(s); 421 418 return 0; 422 419 } 423 420