Skip to content
Commit 53db33a4 authored by Bhanusree Pola's avatar Bhanusree Pola Committed by Greg Kroah-Hartman
Browse files

Staging: media: Use !x in place of NULL comparision



Test for NULL as !x instead of NULL comparisions for
functions that return NULL on failure.
Issue found using coccinelle
Semantic patch used to solve the problem is as follows

// <smpl>
@@
expression x;
statement S;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

-if(x==NULL)
+if(!x)
// </smpl>

Signed-off-by: default avatarBhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85b45ead
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment