aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
diff options
context:
space:
mode:
authorsimran singhal <singhalsimran0@gmail.com>2017-03-04 22:16:55 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-09 19:06:36 +0100
commit6c849caf817da0c4e61003644043d55009114af8 (patch)
tree7361c09328a5a180110ced9ae4e5a8cd662aae59 /drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
parentstaging: sm750fb: Removed unnecessary parentheses. (diff)
downloadlinux-dev-6c849caf817da0c4e61003644043d55009114af8.tar.xz
linux-dev-6c849caf817da0c4e61003644043d55009114af8.zip
staging: vc04_services: 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: simran singhal <singhalsimran0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
index e0ba0ed704fd..7fa0310e7b9e 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
@@ -52,7 +52,7 @@ int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size)
sema_init(&queue->push, 0);
queue->storage = kzalloc(size * sizeof(VCHIQ_HEADER_T *), GFP_KERNEL);
- if (queue->storage == NULL) {
+ if (!queue->storage) {
vchiu_queue_delete(queue);
return 0;
}