]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 8 Feb 2017 22:02:47 +0000 (17:02 -0500)
commit6d37a309c1bc2c3ad3f0296d14188903b89a5884
tree61016d00a0e22db3e3f662f54d603dbd079906c6
parent7a1201e18e2a14612d63668b10cb9cdc66e0eca9
NFSv4: Fix memory and state leak in _nfs4_open_and_get_state

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: 5fb45edbd784 ("NFSv4: Refactor _nfs4_open_and_get_state..")
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4proc.c