]> git.karo-electronics.de Git - linux-beck.git/commit
NFS: Don't leak in nfs_proc_symlink()
authorJesper Juhl <jj@chaosbits.net>
Fri, 24 Dec 2010 22:22:37 +0000 (22:22 +0000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 4 Jan 2011 18:10:36 +0000 (13:10 -0500)
commit878215feb8b2417c4700090b4335739858cf7b5a
tree175172dad3e31faf4cb36262f3ef5fdf2a7bda61
parent1174dd1f890b7f8be8ec6a7071657fe8f59e18b7
NFS: Don't leak in nfs_proc_symlink()

Hi,

In fs/nfs/proc.c::nfs_proc_symlink() we will leak memory if either
nfs_alloc_fhandle() or nfs_alloc_fattr() returns NULL but the other one
doesn't.
This patch ensures memory allocated by one when the other fails is always
released (this is safe since nfs_free_fattr() and nfs_free_fhandle() both
call kfree which deals gracefully with NULL pointers).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/proc.c