]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/bluetooth/mgmt.c
Bluetooth: Log all parameters in cmd_status for easier debugging
[karo-tx-linux.git] / net / bluetooth / mgmt.c
index 46c3edc72cd1dcb85644bf7eaa663c1779a280f4..e6efaae764b38fd2c81826516061ad0f3ec6dc9d 100644 (file)
@@ -49,7 +49,7 @@ static int cmd_status(struct sock *sk, u16 index, u16 cmd, u8 status)
        struct mgmt_hdr *hdr;
        struct mgmt_ev_cmd_status *ev;
 
-       BT_DBG("sock %p", sk);
+       BT_DBG("sock %p, index %u, cmd %u, status %u", sk, index, cmd, status);
 
        skb = alloc_skb(sizeof(*hdr) + sizeof(*ev), GFP_ATOMIC);
        if (!skb)
@@ -92,7 +92,9 @@ static int cmd_complete(struct sock *sk, u16 index, u16 cmd, void *rp,
 
        ev = (void *) skb_put(skb, sizeof(*ev) + rp_len);
        put_unaligned_le16(cmd, &ev->opcode);
-       memcpy(ev->data, rp, rp_len);
+
+       if (rp)
+               memcpy(ev->data, rp, rp_len);
 
        if (sock_queue_rcv_skb(sk, skb) < 0)
                kfree_skb(skb);