* [PATCH] net: bluetooth: assign len after null check
@ 2022-02-15 2:01 Qing Wang
2022-02-16 10:28 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Qing Wang @ 2022-02-15 2:01 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
David S. Miller, Jakub Kicinski, linux-bluetooth, netdev,
linux-kernel
Cc: Wang Qing
From: Wang Qing <wangqing@vivo.com>
len should be assigned after a null check
Signed-off-by: Wang Qing <wangqing@vivo.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: bluetooth: assign len after null check
2022-02-15 2:01 [PATCH] net: bluetooth: assign len after null check Qing Wang
@ 2022-02-16 10:28 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2022-02-16 10:28 UTC (permalink / raw)
To: Qing Wang
Cc: Johan Hedberg, Luiz Augusto von Dentz, David S. Miller,
Jakub Kicinski, linux-bluetooth, netdev, linux-kernel
Hi Qing,
> len should be assigned after a null check
>
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
> net/bluetooth/mgmt_util.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-16 10:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 2:01 [PATCH] net: bluetooth: assign len after null check Qing Wang
2022-02-16 10:28 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).