From: Szymon Janc Date: Tue, 22 Mar 2011 12:12:20 +0000 (+0100) Subject: Bluetooth: Allow for NULL data in mgmt_pending_add X-Git-Tag: MMI-PSA29.97-13-9~19291^2~16^2~94^2~85 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8fce6357a9e72c4c9c846f9951895954bfb34ad1;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Bluetooth: Allow for NULL data in mgmt_pending_add 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 Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index d0c01230bba9..93f0f04c8bcd 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -239,7 +239,8 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode, return NULL; } - memcpy(cmd->param, data, len); + if (data) + memcpy(cmd->param, data, len); cmd->sk = sk; sock_hold(sk);