staging: lustre: Don't leak 'buffer' in cfs_get_environ()
authorJesper Juhl <jj@chaosbits.net>
Mon, 30 Sep 2013 20:44:37 +0000 (22:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2013 01:33:13 +0000 (18:33 -0700)
commitb20204310ad18516146264830bc7b840b6052d57
tree6e444dce6e585d709c09e7d84e59cad6cfab516d
parent78b4c76b5f1371c6161f4d5f9f16e061d69170ae
staging: lustre: Don't leak 'buffer' in cfs_get_environ()

If 'down_read_trylock' fails we'll curently leak the memory allocated to 'buffer'.
Fix the leak by simply kfree'ing 'buffer' before returning '-EDEADLK'.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c