Bluetooth: btusb: fix non-atomic allocation in completion handler
authorJohan Hovold <johan@kernel.org>
Thu, 28 Nov 2019 18:24:27 +0000 (19:24 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 28 Nov 2019 18:29:01 +0000 (19:29 +0100)
USB completion handlers are called in atomic context and must
specifically not allocate memory using GFP_KERNEL.

Fixes: a1c49c434e15 ("Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices")
Cc: stable <stable@vger.kernel.org> # 5.3
Cc: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c

index 82fb2e7b289271790598a445896d2329fb20d9c1..9b587e662b4833c14772208a8b6cc759e39079fe 100644 (file)
@@ -2602,7 +2602,7 @@ static void btusb_mtk_wmt_recv(struct urb *urb)
                 * and being processed the events from there then.
                 */
                if (test_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags)) {
-                       data->evt_skb = skb_clone(skb, GFP_KERNEL);
+                       data->evt_skb = skb_clone(skb, GFP_ATOMIC);
                        if (!data->evt_skb)
                                goto err_out;
                }