NFSv4: Fix memory and state leak in _nfs4_open_and_get_state
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 8 Feb 2017 16:29:46 +0000 (11:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 05:41:51 +0000 (06:41 +0100)
commit0465339eb54953f0be1f03e980b07eeb01e16fca
tree6bd30e1ff461827015fae7513be1c66522982f84
parenta3c6cbc4eac4473ed5461d5faae2794d3e5c0e44
NFSv4: Fix memory and state leak in _nfs4_open_and_get_state

commit a974deee477af89411e0f80456bfb344ac433c98 upstream.

If we exit because the file access check failed, we currently
leak the struct nfs4_state. We need to attach it to the
open context before returning.

Fixes: 3efb9722475e ("NFSv4: Refactor _nfs4_open_and_get_state..")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c