diff mbox

[08/15] NFSv4: Fix a potentially Oopsable condition in __nfs_idmap_unregister

Message ID 1377637132-53318-8-git-send-email-Trond.Myklebust@netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Trond Myklebust Aug. 27, 2013, 8:58 p.m. UTC
Ensure that __nfs_idmap_unregister can be called twice without
consequences.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/idmap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index e9b0c59..8b7e94a 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -404,8 +404,10 @@  static struct key_type key_type_id_resolver_legacy = {
 
 static void __nfs_idmap_unregister(struct rpc_pipe *pipe)
 {
-	if (pipe->dentry)
+	if (pipe->dentry) {
 		rpc_unlink(pipe->dentry);
+		pipe->dentry = NULL;
+	}
 }
 
 static int __nfs_idmap_register(struct dentry *dir,