From: Sean Wang Date: Tue, 22 Mar 2022 23:30:40 +0000 (+0800) Subject: Bluetooth: mt7921s: Fix the incorrect pointer check X-Git-Tag: v5.19-rc1~159^2~6^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=789f6b8ac3b15bca09b69d5699cad0bf6e2103aa;p=thirdparty%2Fkernel%2Flinux.git Bluetooth: mt7921s: Fix the incorrect pointer check Fix the incorrect pointer check on ven_data. Fixes: f41b91fa1783 ("Bluetooth: mt7921s: Add .btmtk_get_codec_config_data") Co-developed-by: Yake Yang Signed-off-by: Yake Yang Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index f3dc5881fff70..b6d77e04240ca 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -961,7 +961,7 @@ static int btmtksdio_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; }