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:37:30 +0000 (06:37 +0100)
commit52fb4bdcea4c0e1b81ed06641083e83ac53f6284
tree554640a2ca556d758a4190ccd2113ad9001d9986
parent3ee4f442e5b37a537297b812557b1163f96b5399
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