diff options
| author | Julia Lawall <[email protected]> | 2010-08-11 10:11:41 +0000 |
|---|---|---|
| committer | Tyler Hicks <[email protected]> | 2010-08-27 15:50:52 +0000 |
| commit | f137f15072411618e37b338aa13e5ae43583bcf2 (patch) | |
| tree | a1679017c58f65b7fd20febab16bb338354bd59b /net/unix/af_unix.c | |
| parent | Linux 2.6.36-rc2 (diff) | |
| download | kernel-f137f15072411618e37b338aa13e5ae43583bcf2.tar.gz kernel-f137f15072411618e37b338aa13e5ae43583bcf2.zip | |
fs/ecryptfs: Return -ENOMEM on memory allocation failure
In this code, 0 is returned on memory allocation failure, even though other
failures return -ENOMEM or other similar values.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression ret;
expression x,e1,e2,e3;
@@
ret = 0
... when != ret = e1
*x = \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Tyler Hicks <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
