Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: btintel: Fix incorrect out of memory check

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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Colin Ian King and committed by
Marcel Holtmann
8bba13b1 5031ffcc

+1 -1
+1 -1
drivers/bluetooth/btintel.c
··· 2176 2176 } 2177 2177 2178 2178 *ven_data = kmalloc(sizeof(__u8), GFP_KERNEL); 2179 - if (!ven_data) { 2179 + if (!*ven_data) { 2180 2180 err = -ENOMEM; 2181 2181 goto error; 2182 2182 }