X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Frxrpc%2Ftransport.c;h=4268b38d92d25e4d66a972e1b498793b6004400b;hb=refs%2Fheads%2Fvserver;hp=dbe6105e83a54e1f9ce66b4466a2863e0d7f155f;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/net/rxrpc/transport.c b/net/rxrpc/transport.c index dbe6105e8..4268b38d9 100644 --- a/net/rxrpc/transport.c +++ b/net/rxrpc/transport.c @@ -31,7 +31,6 @@ #endif #include #include -#include #include "internal.h" struct errormsg { @@ -68,11 +67,10 @@ int rxrpc_create_transport(unsigned short port, _enter("%hu", port); - trans = kmalloc(sizeof(struct rxrpc_transport), GFP_KERNEL); + trans = kzalloc(sizeof(struct rxrpc_transport), GFP_KERNEL); if (!trans) return -ENOMEM; - memset(trans, 0, sizeof(struct rxrpc_transport)); atomic_set(&trans->usage, 1); INIT_LIST_HEAD(&trans->services); INIT_LIST_HEAD(&trans->link); @@ -312,13 +310,12 @@ static int rxrpc_incoming_msg(struct rxrpc_transport *trans, _enter(""); - msg = kmalloc(sizeof(struct rxrpc_message), GFP_KERNEL); + msg = kzalloc(sizeof(struct rxrpc_message), GFP_KERNEL); if (!msg) { _leave(" = -ENOMEM"); return -ENOMEM; } - memset(msg, 0, sizeof(*msg)); atomic_set(&msg->usage, 1); list_add_tail(&msg->link,msgq); @@ -383,11 +380,10 @@ static int rxrpc_incoming_msg(struct rxrpc_transport *trans, /* allocate a new message record */ ret = -ENOMEM; - msg = kmalloc(sizeof(struct rxrpc_message), GFP_KERNEL); + msg = kmemdup(jumbomsg, sizeof(struct rxrpc_message), GFP_KERNEL); if (!msg) goto error; - memcpy(msg, jumbomsg, sizeof(*msg)); list_add_tail(&msg->link, msgq); /* adjust the jumbo packet */