Thread (8 messages) flat view 8 messages, 2 authors, 2011-03-17
STALE5623d

[PATCH v2 2/4] Bluetooth: Allow for NULL data in mgmt_pending_add

From: Szymon Janc <hidden>
Date: 2011-03-01 17:23:34
Subsystem: bluetooth subsystem, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

Since index is in mgmt_hdr it is possible to have mgmt command with
no parameters that still needs to add itself to pending list.

Signed-off-by: Szymon Janc <redacted>
---
 net/bluetooth/mgmt.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index bde42a5..97d7240 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -235,7 +235,8 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode,
 		return NULL;
 	}
 
-	memcpy(cmd->cmd_params, data, len);
+	if (data)
+		memcpy(cmd->cmd_params, data, len);
 
 	cmd->sk = sk;
 	sock_hold(sk);
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help