patch-2.1.58 linux/net/sunrpc/pmap_clnt.c

Next file: linux/net/sunrpc/sched.c
Previous file: linux/net/sunrpc/clnt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.57/linux/net/sunrpc/pmap_clnt.c linux/net/sunrpc/pmap_clnt.c
@@ -54,15 +54,16 @@
 	}
 	clnt->cl_binding = 1;
 
-	task->tk_status = 0;
-	if (!(pmap_clnt = pmap_create(clnt->cl_server, sap, map->pm_prot))) {
-		task->tk_status = -EACCES;
+	task->tk_status = -EACCES; /* why set this? returns -EIO below */
+	if (!(pmap_clnt = pmap_create(clnt->cl_server, sap, map->pm_prot)))
 		goto bailout;
-	}
-	if (!(child = rpc_new_child(pmap_clnt, task))) {
-		rpc_destroy_client(pmap_clnt);
+	task->tk_status = 0;
+
+	/*
+	 * Note: rpc_new_child will release client after a failure.
+	 */
+	if (!(child = rpc_new_child(pmap_clnt, task)))
 		goto bailout;
-	}
 
 	/* Setup the call info struct */
 	rpc_call_setup(child, PMAP_GETPORT, map, &clnt->cl_port, 0);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov