summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/btrtl.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-11-10 12:39:15 +0000
committerMarcel Holtmann <marcel@holtmann.org>2020-11-11 11:53:56 +0100
commitf5e8e215869eed6163d5fdd309f0e674a0f23df6 (patch)
tree914afb6b374b8c6cbc8560c31ffb84fae7046b2b /drivers/bluetooth/btrtl.c
parent844c79bd5995185cf1ab56e4eae9dd9e50204aeb (diff)
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: 1996d9cad6ad ("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>
Diffstat (limited to 'drivers/bluetooth/btrtl.c')
-rw-r--r--drivers/bluetooth/btrtl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index e47736a12f77..a4f7cace66b0 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -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));