diff options
Diffstat (limited to 'net/rxrpc/connection.c')
| -rw-r--r-- | net/rxrpc/connection.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/rxrpc/connection.c b/net/rxrpc/connection.c index 573b572f8f91..93d2c55ad2d5 100644 --- a/net/rxrpc/connection.c +++ b/net/rxrpc/connection.c | |||
| @@ -58,13 +58,12 @@ static inline int __rxrpc_create_connection(struct rxrpc_peer *peer, | |||
| 58 | _enter("%p",peer); | 58 | _enter("%p",peer); |
| 59 | 59 | ||
| 60 | /* allocate and initialise a connection record */ | 60 | /* allocate and initialise a connection record */ |
| 61 | conn = kmalloc(sizeof(struct rxrpc_connection), GFP_KERNEL); | 61 | conn = kzalloc(sizeof(struct rxrpc_connection), GFP_KERNEL); |
| 62 | if (!conn) { | 62 | if (!conn) { |
| 63 | _leave(" = -ENOMEM"); | 63 | _leave(" = -ENOMEM"); |
| 64 | return -ENOMEM; | 64 | return -ENOMEM; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | memset(conn, 0, sizeof(struct rxrpc_connection)); | ||
| 68 | atomic_set(&conn->usage, 1); | 67 | atomic_set(&conn->usage, 1); |
| 69 | 68 | ||
| 70 | INIT_LIST_HEAD(&conn->link); | 69 | INIT_LIST_HEAD(&conn->link); |
| @@ -535,13 +534,12 @@ int rxrpc_conn_newmsg(struct rxrpc_connection *conn, | |||
| 535 | return -EINVAL; | 534 | return -EINVAL; |
| 536 | } | 535 | } |
| 537 | 536 | ||
| 538 | msg = kmalloc(sizeof(struct rxrpc_message), alloc_flags); | 537 | msg = kzalloc(sizeof(struct rxrpc_message), alloc_flags); |
| 539 | if (!msg) { | 538 | if (!msg) { |
| 540 | _leave(" = -ENOMEM"); | 539 | _leave(" = -ENOMEM"); |
| 541 | return -ENOMEM; | 540 | return -ENOMEM; |
| 542 | } | 541 | } |
| 543 | 542 | ||
| 544 | memset(msg, 0, sizeof(*msg)); | ||
| 545 | atomic_set(&msg->usage, 1); | 543 | atomic_set(&msg->usage, 1); |
| 546 | 544 | ||
| 547 | INIT_LIST_HEAD(&msg->link); | 545 | INIT_LIST_HEAD(&msg->link); |
