aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2005-10-23 22:32:47 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 11:35:58 -0800
commit99ffd10ad27caaba5995b9b667b53982c3502418 (patch)
tree62ff495d8bbfee858be91c09b5a583dc046bd109
parent16dbfc8e2b0b3ed5f94652587c79cd7083da033f (diff)
downloadlibibverbs-99ffd10ad27caaba5995b9b667b53982c3502418.tar.gz
Fix buffer size computation in ibv_cmd_get_context_v2()
Correct silly mistake in ibv_cmd_get_context_v2() computation of size of buffer for old ABI command: we need to use sizeof *cmd instead of sizeof cmd, since cmd is a pointer. Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--ChangeLog6
-rw-r--r--src/cmd.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3892019..3f47166 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-23 Roland Dreier <roland@cisco.com>
+
+ * src/cmd.c (ibv_cmd_get_context_v2): Correct silly mistake in
+ computation of size of buffer for old ABI command: we need to use
+ sizeof *cmd instead of sizeof cmd, since cmd is a pointer.
+
2005-10-21 Roland Dreier <roland@cisco.com>
* src/cmd.c (ibv_cmd_post_send, ibv_cmd_post_recv,
diff --git a/src/cmd.c b/src/cmd.c
index 08cea2b..ce7ffef 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -60,7 +60,7 @@ static int ibv_cmd_get_context_v2(struct ibv_context *context,
return ENOMEM;
pthread_mutex_init(&t->in_use, NULL);
- cmd_size = sizeof cmd + new_cmd_size - sizeof *new_cmd;
+ cmd_size = sizeof *cmd + new_cmd_size - sizeof *new_cmd;
cmd = alloca(cmd_size);
memcpy(cmd->driver_data, new_cmd->driver_data, new_cmd_size - sizeof *new_cmd);