mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
Bluetooth: btrtl: fix incorrect skb allocation failure check
Currently the check for a failed bt_skb_alloc allocation is incorrectly
checking using IS_ERR and this can lead to a null pointer dereference. Fix
this by checking for a null pointer return using the !skb idiom.
Addresses-Coverity: ("Dereference null return")
Fixes: 1996d9cad6
("Bluetooth: btrtl: Ask 8821C to drop old firmware")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
844c79bd59
commit
f5e8e21586
@ -581,7 +581,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
|
||||
cmd[1] = opcode >> 8;
|
||||
|
||||
skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL);
|
||||
if (IS_ERR(skb))
|
||||
if (!skb)
|
||||
goto out_free;
|
||||
|
||||
skb_put_data(skb, cmd, sizeof(cmd));
|
||||
|
Loading…
Reference in New Issue
Block a user