Commit 2e8ecb4b authored by Wang Qing's avatar Wang Qing Committed by Marcel Holtmann

Bluetooth: assign len after null check

len should be assigned after a null check
Signed-off-by: default avatarWang Qing <wangqing@vivo.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 29fb6083
...@@ -77,11 +77,12 @@ int mgmt_send_event_skb(unsigned short channel, struct sk_buff *skb, int flag, ...@@ -77,11 +77,12 @@ int mgmt_send_event_skb(unsigned short channel, struct sk_buff *skb, int flag,
{ {
struct hci_dev *hdev; struct hci_dev *hdev;
struct mgmt_hdr *hdr; struct mgmt_hdr *hdr;
int len = skb->len; int len;
if (!skb) if (!skb)
return -EINVAL; return -EINVAL;
len = skb->len;
hdev = bt_cb(skb)->mgmt.hdev; hdev = bt_cb(skb)->mgmt.hdev;
/* Time stamp */ /* Time stamp */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment