[PATCH] CacheFiles: Fix memory leak in cachefiles_check_auxdata error paths

2013-09-11 Thread David Howells
From: Josh Boyer In cachefiles_check_auxdata(), we allocate auxbuf but fail to free it if we get determine there's an error or that the data is stale. Further, assigning the output of vfs_getxattr() to auxbuf->len gives problems with checking for errors as auxbuf->len is a u16. We don't actuall

[PATCH] CacheFiles: Fix memory leak in cachefiles_check_auxdata error paths

2013-09-10 Thread Josh Boyer
We kmalloc auxbuf but fail to kfree it if we get errors in various places. Rework the error paths to avoid the resource leak. Signed-off-by: Josh Boyer --- fs/cachefiles/xattr.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/fs/cachefiles/xattr.c b/