Skip to contentSkip to conversation

Bluetooth: mgmt: Introduce mgmt_alloc_skb and mgmt_send_event_skb

bug report Dan Carpenter 1 participant 1 message Dec 9, 2021 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello Luiz Augusto von Dentz,

This is a semi-automatic email about new static checker warnings.

The patch 8aca46f91c42: "Bluetooth: mgmt: Introduce mgmt_alloc_skb and mgmt_send_event_skb" from Dec 3, 2021, leads to the following Smatch complaint:

net/bluetooth/mgmt_util.c:82 mgmt_send_event_skb()
warn: variable dereferenced before check 'skb' (see line 80)

net/bluetooth/mgmt_util.c

    79		struct mgmt_hdr *hdr;
    80		int len = skb->len;
                          ^^^^^^^^^

Dereference

    81	
    82		if (!skb)
                    ^^^^

Too late

    83			return -EINVAL;
    84	

regards,
dan carpenter