vserver 2.0 rc7
[linux-2.6.git] / fs / nfs / unlink.c
index 2b0a0cc..f732541 100644 (file)
@@ -167,6 +167,11 @@ nfs_async_unlink(struct dentry *dentry)
                goto out;
        memset(data, 0, sizeof(*data));
 
+       data->cred = rpcauth_lookupcred(clnt->cl_auth, 0);
+       if (IS_ERR(data->cred)) {
+               status = PTR_ERR(data->cred);
+               goto out_free;
+       }
        data->dir = dget(dir);
        data->dentry = dentry;
 
@@ -183,12 +188,14 @@ nfs_async_unlink(struct dentry *dentry)
        spin_lock(&dentry->d_lock);
        dentry->d_flags |= DCACHE_NFSFS_RENAMED;
        spin_unlock(&dentry->d_lock);
-       data->cred = rpcauth_lookupcred(clnt->cl_auth, 0);
 
        rpc_sleep_on(&nfs_delete_queue, task, NULL, NULL);
        status = 0;
  out:
        return status;
+out_free:
+       kfree(data);
+       return status;
 }
 
 /**