diff options
author | Wang Qing <wangqing@vivo.com> | 2022-02-15 03:01:56 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2022-02-24 21:05:21 +0100 |
commit | 2e8ecb4bbc13d4752d64a9f8f5512d59125cab25 (patch) | |
tree | 5fa9e9dc25e26db5a57d2ed994ab27c424ddda3e /net/bluetooth/mgmt_util.c | |
parent | Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks (diff) | |
download | linux-2e8ecb4bbc13d4752d64a9f8f5512d59125cab25.tar.xz linux-2e8ecb4bbc13d4752d64a9f8f5512d59125cab25.zip |
Bluetooth: assign len after null check
len should be assigned after a null check
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt_util.c')
-rw-r--r-- | net/bluetooth/mgmt_util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt_util.c b/net/bluetooth/mgmt_util.c index edee60bbc7b4..37eef2ce55ae 100644 --- a/net/bluetooth/mgmt_util.c +++ b/net/bluetooth/mgmt_util.c @@ -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 */ |