Bug in transport init failure recovery
Pete Zaitcev
zaitcev at redhat.com
Tue Jan 6 17:51:26 GMT 2004
Freshly created trans cannot be just "put", because rxrpc_put_transport
assumes a wholly constructed trans. This causes an oops.
-- Pete
diff -urN -X dontdiff linux-2.6.0/net/rxrpc/transport.c linux-2.6.0-kafs/net/rxrpc/transport.c
--- linux-2.6.0/net/rxrpc/transport.c 2003-10-01 15:18:26.000000000 -0700
+++ linux-2.6.0-kafs/net/rxrpc/transport.c 2004-01-06 14:46:20.000000000 -0800
@@ -130,7 +130,18 @@
return 0;
error:
- rxrpc_put_transport(trans);
+ /* finish cleaning up the transport (not really needed here, but...) */
+ if (trans->socket)
+ trans->socket->ops->shutdown(trans->socket, 2);
+
+ /* close the socket */
+ if (trans->socket) {
+ trans->socket->sk->sk_user_data = NULL;
+ sock_release(trans->socket);
+ trans->socket = NULL;
+ }
+
+ kfree(trans);
_leave(" = %d", ret);
return ret;
More information about the linux-afs
mailing list