mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
a0ee7c70b2
commit
0da974f4f3
94 changed files with 154 additions and 334 deletions
|
|
@ -58,13 +58,12 @@ static inline int __rxrpc_create_connection(struct rxrpc_peer *peer,
|
|||
_enter("%p",peer);
|
||||
|
||||
/* allocate and initialise a connection record */
|
||||
conn = kmalloc(sizeof(struct rxrpc_connection), GFP_KERNEL);
|
||||
conn = kzalloc(sizeof(struct rxrpc_connection), GFP_KERNEL);
|
||||
if (!conn) {
|
||||
_leave(" = -ENOMEM");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(conn, 0, sizeof(struct rxrpc_connection));
|
||||
atomic_set(&conn->usage, 1);
|
||||
|
||||
INIT_LIST_HEAD(&conn->link);
|
||||
|
|
@ -535,13 +534,12 @@ int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
msg = kmalloc(sizeof(struct rxrpc_message), alloc_flags);
|
||||
msg = kzalloc(sizeof(struct rxrpc_message), alloc_flags);
|
||||
if (!msg) {
|
||||
_leave(" = -ENOMEM");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(msg, 0, sizeof(*msg));
|
||||
atomic_set(&msg->usage, 1);
|
||||
|
||||
INIT_LIST_HEAD(&msg->link);
|
||||
|
|
|
|||
|
|
@ -58,13 +58,12 @@ static int __rxrpc_create_peer(struct rxrpc_transport *trans, __be32 addr,
|
|||
_enter("%p,%08x", trans, ntohl(addr));
|
||||
|
||||
/* allocate and initialise a peer record */
|
||||
peer = kmalloc(sizeof(struct rxrpc_peer), GFP_KERNEL);
|
||||
peer = kzalloc(sizeof(struct rxrpc_peer), GFP_KERNEL);
|
||||
if (!peer) {
|
||||
_leave(" = -ENOMEM");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(peer, 0, sizeof(struct rxrpc_peer));
|
||||
atomic_set(&peer->usage, 1);
|
||||
|
||||
INIT_LIST_HEAD(&peer->link);
|
||||
|
|
|
|||
|
|
@ -68,11 +68,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 +311,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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue