diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2009-04-09 10:09:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-09 20:21:21 -0400 |
commit | 05a178ecdc7396b78dfbb5d8bda65108b37b8672 (patch) | |
tree | f500fe4a1d732a933d72824752deb681667bfd8b /net/rds | |
parent | 9c56a84478b708e5d8d34d28cc3a8e71842d5b05 (diff) |
rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
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>
Diffstat (limited to 'net/rds')
-rw-r--r-- | net/rds/connection.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c index 273f064930a..d14445c4830 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
@@ -148,14 +148,12 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr, | |||
148 | if (conn) | 148 | if (conn) |
149 | goto out; | 149 | goto out; |
150 | 150 | ||
151 | conn = kmem_cache_alloc(rds_conn_slab, gfp); | 151 | conn = kmem_cache_zalloc(rds_conn_slab, gfp); |
152 | if (conn == NULL) { | 152 | if (conn == NULL) { |
153 | conn = ERR_PTR(-ENOMEM); | 153 | conn = ERR_PTR(-ENOMEM); |
154 | goto out; | 154 | goto out; |
155 | } | 155 | } |
156 | 156 | ||
157 | memset(conn, 0, sizeof(*conn)); | ||
158 | |||
159 | INIT_HLIST_NODE(&conn->c_hash_node); | 157 | INIT_HLIST_NODE(&conn->c_hash_node); |
160 | conn->c_version = RDS_PROTOCOL_3_0; | 158 | conn->c_version = RDS_PROTOCOL_3_0; |
161 | conn->c_laddr = laddr; | 159 | conn->c_laddr = laddr; |