aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/mgmt.c6
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);