[bug report] Bluetooth: mgmt: Introduce mgmt_alloc_skb and mgmt_send_event_skb

From: Dan Carpenter <hidden>
Date: 2021-12-09 15:09:12

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help