Return-Path: From: Szymon Janc To: CC: , , Szymon Janc Subject: [PATCH v3 2/5] Bluetooth: Allow for NULL data in mgmt_pending_add Date: Mon, 21 Mar 2011 14:06:58 +0100 Message-ID: <1300712821-23172-3-git-send-email-szymon.janc@tieto.com> In-Reply-To: <1300712821-23172-1-git-send-email-szymon.janc@tieto.com> References: <1300712821-23172-1-git-send-email-szymon.janc@tieto.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-bluetooth-owner@vger.kernel.org List-ID: 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 --- 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 657a02d..ebf495d 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); -- 1.7.0.4