Эх сурвалжийг харах

NFSv4: Fix a potentially Oopsable condition in __nfs_idmap_unregister

Ensure that __nfs_idmap_unregister can be called twice without
consequences.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Trond Myklebust 12 жил өмнө
parent
commit
d7631250b2
1 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 3 1
      fs/nfs/idmap.c

+ 3 - 1
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,