[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1644890516-65362-1-git-send-email-wangqing@vivo.com>
Date: Mon, 14 Feb 2022 18:01:56 -0800
From: Qing Wang <wangqing@...o.com>
To: Marcel Holtmann <marcel@...tmann.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
linux-bluetooth@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Wang Qing <wangqing@...o.com>
Subject: [PATCH] net: bluetooth: assign len after null check
From: Wang Qing <wangqing@...o.com>
len should be assigned after a null check
Signed-off-by: Wang Qing <wangqing@...o.com>
---
net/bluetooth/mgmt_util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/mgmt_util.c b/net/bluetooth/mgmt_util.c
index edee60b..37eef2c
--- 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 */
--
2.7.4
Powered by blists - more mailing lists