[PATCH] kmemdup: some users
[linux-2.6.git] / net / rxrpc / transport.c
index 465efc86fccf1f253cf93a4e5705017e6e1dd83d..94b2e2fe6fdb97ec548956f1d247d5da8ad4c70b 100644 (file)
@@ -381,11 +381,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 */