diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/addr.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_cm.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index a91001c59b69..c5c33d35f87d 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c | |||
@@ -295,10 +295,9 @@ int rdma_resolve_ip(struct rdma_addr_client *client, | |||
295 | struct addr_req *req; | 295 | struct addr_req *req; |
296 | int ret = 0; | 296 | int ret = 0; |
297 | 297 | ||
298 | req = kmalloc(sizeof *req, GFP_KERNEL); | 298 | req = kzalloc(sizeof *req, GFP_KERNEL); |
299 | if (!req) | 299 | if (!req) |
300 | return -ENOMEM; | 300 | return -ENOMEM; |
301 | memset(req, 0, sizeof *req); | ||
302 | 301 | ||
303 | if (src_addr) | 302 | if (src_addr) |
304 | memcpy(&req->src_addr, src_addr, ip_addr_size(src_addr)); | 303 | memcpy(&req->src_addr, src_addr, ip_addr_size(src_addr)); |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 5dc68cd5621b..9574088f0d4e 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -229,9 +229,8 @@ static void *alloc_ep(int size, gfp_t gfp) | |||
229 | { | 229 | { |
230 | struct iwch_ep_common *epc; | 230 | struct iwch_ep_common *epc; |
231 | 231 | ||
232 | epc = kmalloc(size, gfp); | 232 | epc = kzalloc(size, gfp); |
233 | if (epc) { | 233 | if (epc) { |
234 | memset(epc, 0, size); | ||
235 | kref_init(&epc->kref); | 234 | kref_init(&epc->kref); |
236 | spin_lock_init(&epc->lock); | 235 | spin_lock_init(&epc->lock); |
237 | init_waitqueue_head(&epc->waitq); | 236 | init_waitqueue_head(&epc->waitq); |