Skip to content

Commit

Permalink
Bluetooth: btintel: Fix incorrect out of memory check
Browse files Browse the repository at this point in the history
Currently *ven_data is being assigned the return from a kmalloc call but
the out-of-memory check is checking ven_data and not *ven_data. Fix this
by adding the missing dereference * operator,

Addresses-Coverity: ("Dereference null return")
Fixes: 70dd978 ("Bluetooth: btintel: Define a callback to fetch codec config data")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Colin Ian King authored and Marcel Holtmann committed Sep 10, 2021
1 parent 5031ffc commit 8bba13b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/bluetooth/btintel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ static int btintel_get_codec_config_data(struct hci_dev *hdev,
}

*ven_data = kmalloc(sizeof(__u8), GFP_KERNEL);
if (!ven_data) {
if (!*ven_data) {
err = -ENOMEM;
goto error;
}
Expand Down

0 comments on commit 8bba13b

Please sign in to comment.