[NFS SUNRPC] fix

From: James Morris
Date: Fri Feb 27 2004 - 16:36:31 EST


The patch below fixes a bug in the error handling code of
xprt_create_socket(). If sock_create() fails, we should not try and
release the non existent socket.

This fix is by James Carter <jwcart2@xxxxxxxxxxxxxx>.

Please apply.


- James
--
James Morris
<jmorris@xxxxxxxxxx>


diff -urN -X dontdiff linux-2.6.3-mm4.o/net/sunrpc/xprt.c linux-2.6.3-mm4.w/net/sunrpc/xprt.c
--- linux-2.6.3-mm4.o/net/sunrpc/xprt.c 2004-02-25 22:42:16.000000000 -0500
+++ linux-2.6.3-mm4.w/net/sunrpc/xprt.c 2004-02-27 16:13:34.230834288 -0500
@@ -1581,7 +1581,7 @@

if ((err = sock_create(PF_INET, type, proto, &sock)) < 0) {
printk("RPC: can't create socket (%d).\n", -err);
- goto failed;
+ return NULL;
}

/* If the caller has the capability, bind to a reserved port */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/