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:11:55 -0800
commit03554590f8b5fcf673d424dd48d66dd465c27bed (patch)
treec8567cacc7aa8f8d191243401fc4dcb4fe139801
parent2928d7724eef10fd770237af4b266ec59e9772f2 (diff)
downloadlibmlx4-03554590f8b5fcf673d424dd48d66dd465c27bed.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/mlx4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mlx4.c b/src/mlx4.c
index b2e2ba9..34ece39 100644
--- a/src/mlx4.c
+++ b/src/mlx4.c
@@ -105,7 +105,7 @@ static struct ibv_context *mlx4_alloc_context(struct ibv_device *ibdev, int cmd_
struct mlx4_alloc_ucontext_resp resp;
int i;
- context = malloc(sizeof *context);
+ context = calloc(1, sizeof *context);
if (!context)
return NULL;