aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2007-12-17 10:19:21 +0200
committerRoland Dreier <rolandd@cisco.com>2007-12-18 11:13:06 -0800
commit3a89c5cb9f6a31f3f192ff5ac087e7cb3aa89fc7 (patch)
treebc89e3af6db6cc784a9574389499043069e485af
parentd599b153d6c5bc00aec3924f67769cab26a42107 (diff)
downloadlibmthca-3a89c5cb9f6a31f3f192ff5ac087e7cb3aa89fc7.tar.gz
Clear context struct at allocation time
Future versions of libibverbs will add additional ops to the end of struct ibv_context. This means that driver libraries should zero the entire struct ibv_context at allocation time, so that any new ops will be NULL by default. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--src/mthca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mthca.c b/src/mthca.c
index 0f7e953..e00c4ee 100644
--- a/src/mthca.c
+++ b/src/mthca.c
@@ -138,7 +138,7 @@ static struct ibv_context *mthca_alloc_context(struct ibv_device *ibdev, int cmd
struct mthca_alloc_ucontext_resp resp;
int i;
- context = malloc(sizeof *context);
+ context = calloc(1, sizeof *context);
if (!context)
return NULL;