Skip to content

Commit

Permalink
rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Browse files Browse the repository at this point in the history
Use kmem_cache_zalloc instead of kmem_cache_alloc/memset.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Apr 10, 2009
1 parent 9c56a84 commit 05a178e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/rds/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,12 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
if (conn)
goto out;

conn = kmem_cache_alloc(rds_conn_slab, gfp);
conn = kmem_cache_zalloc(rds_conn_slab, gfp);
if (conn == NULL) {
conn = ERR_PTR(-ENOMEM);
goto out;
}

memset(conn, 0, sizeof(*conn));

INIT_HLIST_NODE(&conn->c_hash_node);
conn->c_version = RDS_PROTOCOL_3_0;
conn->c_laddr = laddr;
Expand Down

0 comments on commit 05a178e

Please sign in to comment.