]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: mt7921s: Fix the incorrect pointer check
authorSean Wang <sean.wang@mediatek.com>
Tue, 22 Mar 2022 23:30:40 +0000 (07:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:30:13 +0000 (10:30 +0200)
[ Upstream commit 789f6b8ac3b15bca09b69d5699cad0bf6e2103aa ]

Fix the incorrect pointer check on ven_data.

Fixes: f41b91fa1783 ("Bluetooth: mt7921s: Add .btmtk_get_codec_config_data")
Co-developed-by: Yake Yang <yake.yang@mediatek.com>
Signed-off-by: Yake Yang <yake.yang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btmtksdio.c

index f3dc5881fff704811aca51d1c59ed2ba1ff5c074..b6d77e04240cadb46df5e4b769034b6a33e516a7 100644 (file)
@@ -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;
        }