Kaynağa Gözat

nfsd4: fix minor memory leak

There's no need to allocate this cred more than once.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
J. Bruce Fields 15 yıl önce
ebeveyn
işleme
8d75da8afd
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2 0
      fs/nfsd/nfs4callback.c

+ 2 - 0
fs/nfsd/nfs4callback.c

@@ -525,6 +525,8 @@ static struct rpc_cred *callback_cred;
 
 int set_callback_cred(void)
 {
+	if (callback_cred)
+		return 0;
 	callback_cred = rpc_lookup_machine_cred();
 	if (!callback_cred)
 		return -ENOMEM;