]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: btusb: Do not call kfree_skb() under spin_lock_irqsave()
authorJinjie Ruan <ruanjinjie@huawei.com>
Wed, 23 Aug 2023 03:46:37 +0000 (11:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:07 +0000 (09:48 +0200)
[ Upstream commit 2a05334d7f91ff189692089c05fc48cc1d8204de ]

It is not allowed to call kfree_skb() from hardware interrupt
context or with hardware interrupts being disabled.
So replace kfree_skb() with dev_kfree_skb_irq() under
spin_lock_irqsave(). Compile tested only.

Fixes: baac6276c0a9 ("Bluetooth: btusb: handle mSBC audio over USB Endpoints")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btusb.c

index 025e803ba55c28bb4ab81a47980ea7279bfa5897..5559d6d8ae8b2b9fb3ff2805fd456a79df801623 100644 (file)
@@ -2077,7 +2077,7 @@ static int btusb_switch_alt_setting(struct hci_dev *hdev, int new_alts)
                 * alternate setting.
                 */
                spin_lock_irqsave(&data->rxlock, flags);
-               kfree_skb(data->sco_skb);
+               dev_kfree_skb_irq(data->sco_skb);
                data->sco_skb = NULL;
                spin_unlock_irqrestore(&data->rxlock, flags);