Skip to content

Commit

Permalink
Bluetooth: assign len after null check
Browse files Browse the repository at this point in the history
len should be assigned after a null check

Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Wang Qing authored and Marcel Holtmann committed Feb 24, 2022
1 parent 29fb608 commit 2e8ecb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/bluetooth/mgmt_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ int mgmt_send_event_skb(unsigned short channel, struct sk_buff *skb, int flag,
{
struct hci_dev *hdev;
struct mgmt_hdr *hdr;
int len = skb->len;
int len;

if (!skb)
return -EINVAL;

len = skb->len;
hdev = bt_cb(skb)->mgmt.hdev;

/* Time stamp */
Expand Down

0 comments on commit 2e8ecb4

Please sign in to comment.