diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-05 06:36:01 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-12-05 06:46:09 -0500 |
commit | 323b0b885b5586a39a288d8f10c3a6c7ba901282 (patch) | |
tree | a59016663c609a83534594268ddc6b48499367f3 /net | |
parent | 1b9b5ee53023b7299495c01fbee17f1985ec0d47 (diff) |
Bluetooth: Store parameter length with pending mgmt commands
As preparation for making generic cmd_complete responses possible we'll
need to track the parameter length in addition to just a pointer to
them. This patch adds the necessary variable to the pending_cmd struct.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/mgmt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 98537b07b720..56c7838c0a41 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -135,6 +135,7 @@ struct pending_cmd { | |||
135 | u16 opcode; | 135 | u16 opcode; |
136 | int index; | 136 | int index; |
137 | void *param; | 137 | void *param; |
138 | size_t param_len; | ||
138 | struct sock *sk; | 139 | struct sock *sk; |
139 | void *user_data; | 140 | void *user_data; |
140 | void (*cmd_complete)(struct pending_cmd *cmd, u8 status); | 141 | void (*cmd_complete)(struct pending_cmd *cmd, u8 status); |
@@ -1205,14 +1206,13 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode, | |||
1205 | cmd->opcode = opcode; | 1206 | cmd->opcode = opcode; |
1206 | cmd->index = hdev->id; | 1207 | cmd->index = hdev->id; |
1207 | 1208 | ||
1208 | cmd->param = kmalloc(len, GFP_KERNEL); | 1209 | cmd->param = kmemdup(data, len, GFP_KERNEL); |
1209 | if (!cmd->param) { | 1210 | if (!cmd->param) { |
1210 | kfree(cmd); | 1211 | kfree(cmd); |
1211 | return NULL; | 1212 | return NULL; |
1212 | } | 1213 | } |
1213 | 1214 | ||
1214 | if (data) | 1215 | cmd->param_len = len; |
1215 | memcpy(cmd->param, data, len); | ||
1216 | 1216 | ||
1217 | cmd->sk = sk; | 1217 | cmd->sk = sk; |
1218 | sock_hold(sk); | 1218 | sock_hold(sk); |