err = -EINVAL;
if (!xprt)
- goto out_err;
+ goto out_no_xprt;
if (vers >= program->nrvers || !(version = program->version[vers]))
goto out_err;
err = -ENOMEM;
- clnt = (struct rpc_clnt *) kmalloc(sizeof(*clnt), GFP_KERNEL);
+ clnt = kmalloc(sizeof(*clnt), GFP_KERNEL);
if (!clnt)
goto out_err;
memset(clnt, 0, sizeof(*clnt));
kfree(clnt);
out_err:
xprt_destroy(xprt);
+out_no_xprt:
return ERR_PTR(err);
}
{
struct rpc_clnt *new;
- new = (struct rpc_clnt *)kmalloc(sizeof(*new), GFP_KERNEL);
+ new = kmalloc(sizeof(*new), GFP_KERNEL);
if (!new)
goto out_no_clnt;
memcpy(new, clnt, sizeof(*new));
clnt->cl_dead = 0;
rpc_killall_tasks(clnt);
wait_event_timeout(destroy_wait,
- atomic_read(&clnt->cl_users) > 0, 1*HZ);
+ !atomic_read(&clnt->cl_users), 1*HZ);
}
if (atomic_read(&clnt->cl_users) < 0) {