Commit 95738786 authored by simran singhal's avatar simran singhal Committed by Greg Kroah-Hartman

staging: atomisp_fops: Clean up tests if NULL returned on failure

Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:
@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e
Signed-off-by: default avatarsimran singhal <singhalsimran0@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7cf51d34
......@@ -1100,7 +1100,7 @@ int atomisp_videobuf_mmap_mapper(struct videobuf_queue *q,
continue;
map = kzalloc(sizeof(struct videobuf_mapping), GFP_KERNEL);
if (map == NULL) {
if (!map) {
mutex_unlock(&q->vb_lock);
return -ENOMEM;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment