LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Bluetooth: btintel: Fix incorrect out of memory check
@ 2021-09-09 12:35 Colin King
2021-09-10 7:29 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-09-09 12:35 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Chethan T N, Kiran K, Srivatsa Ravishankar, linux-bluetooth
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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: 70dd978952bc ("Bluetooth: btintel: Define a callback to fetch codec config data")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/bluetooth/btintel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 115bb2d07a8d..9359bff47296 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -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;
}
--
2.32.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: btintel: Fix incorrect out of memory check
2021-09-09 12:35 [PATCH] Bluetooth: btintel: Fix incorrect out of memory check Colin King
@ 2021-09-10 7:29 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2021-09-10 7:29 UTC (permalink / raw)
To: Colin King
Cc: Johan Hedberg, Luiz Augusto von Dentz, Chethan T N, Kiran K,
Srivatsa Ravishankar, linux-bluetooth, kernel-janitors,
linux-kernel
Hi Colin,
> 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: 70dd978952bc ("Bluetooth: btintel: Define a callback to fetch codec config data")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/bluetooth/btintel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-10 7:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 12:35 [PATCH] Bluetooth: btintel: Fix incorrect out of memory check Colin King
2021-09-10 7:29 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).