If not, we cannot guarantee that idmap->idmap_dentry, gss_auth->dentry and
clnt->cl_dentry are valid dentries.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
 
        if (!idmap)
                return;
+       dput(idmap->idmap_dentry);
+       idmap->idmap_dentry = NULL;
        rpc_unlink(idmap->idmap_path);
        clp->cl_idmap = NULL;
        kfree(idmap);
 
 
        gss_auth = container_of(auth, struct gss_auth, rpc_auth);
        rpc_unlink(gss_auth->path);
+       dput(gss_auth->dentry);
+       gss_auth->dentry = NULL;
        gss_mech_put(gss_auth->mech);
 
        rpcauth_free_credcache(auth);
 
        new->cl_autobind = 0;
        new->cl_oneshot = 0;
        new->cl_dead = 0;
+       dget(new->cl_dentry);
        rpc_init_rtt(&new->cl_rtt_default, clnt->cl_xprt->timeout.to_initval);
        if (new->cl_auth)
                atomic_inc(&new->cl_auth->au_count);
        if (clnt->cl_server != clnt->cl_inline_name)
                kfree(clnt->cl_server);
 out_free:
+       if (clnt->cl_dentry)
+               dput(clnt->cl_dentry);
        kfree(clnt);
        return 0;
 }
 
 out:
        mutex_unlock(&dir->i_mutex);
        rpc_release_path(&nd);
-       return dentry;
+       return dget(dentry);
 err_depopulate:
        rpc_depopulate(dentry);
        __rpc_rmdir(dir, dentry);
 out:
        mutex_unlock(&dir->i_mutex);
        rpc_release_path(&nd);
-       return dentry;
+       return dget(dentry);
 err_dput:
        dput(dentry);
        dentry = ERR_PTR(-ENOMEM);