From: Amitoj Kaur Chawla
Date: Thu, 4 Feb 2016 19:25:13 +0530
> The return value of vmalloc on failure of allocation of memory should
> be -ENOMEM and not -1.
>
> Found using Coccinelle. A simplified version of the semantic patch
> used is:
...
> The single call site of the containing function
The return value of vmalloc on failure of allocation of memory should
be -ENOMEM and not -1.
Found using Coccinelle. A simplified version of the semantic patch
used is:
//
@@
expression *e;
identifier l1;
position p,q;
@@
e@q = vmalloc(...);
if@p (e == NULL) {
...
goto l1;
}
l1:
...
return -1
+