linux/fs/ecryptfs
Julia Lawall f137f15072 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 <julia@diku.dk>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2010-08-27 10:50:52 -05:00
..
Kconfig eCryptfs: Remove Kconfig NET dependency and select MD5 2009-10-08 11:31:36 -05:00
Makefile eCryptfs: remove netlink transport 2008-10-16 11:21:39 -07:00
crypto.c fix typos concerning "initiali[zs]e" 2010-06-16 18:05:05 +02:00
debug.c eCryptfs: update comment and debug statement 2007-10-16 09:43:11 -07:00
dentry.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ecryptfs_kernel.h switch ecryptfs_write() to struct inode *, kill on-stack fake files 2010-05-21 18:31:28 -04:00
file.c fs/ecryptfs/file.c: introduce missing free 2010-08-09 13:25:24 -05:00
inode.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6 2010-08-10 12:14:39 -07:00
keystore.c fs/ecryptfs: Return -ENOMEM on memory allocation failure 2010-08-27 10:50:52 -05:00
kthread.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
main.c Ban ecryptfs over ecryptfs 2010-05-21 18:31:27 -04:00
messaging.c ecryptfs: Fix warning in ecryptfs_process_response() 2010-08-09 10:33:03 -05:00
miscdev.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mmap.c switch ecryptfs_get_locked_page() to struct inode * 2010-05-21 18:31:28 -04:00
read_write.c switch ecryptfs_write() to struct inode *, kill on-stack fake files 2010-05-21 18:31:28 -04:00
super.c pass a struct path to vfs_statfs 2010-08-09 16:48:42 -04:00