Skip to contentSkip to conversation

Bluetooth: btusb: fix non-atomic allocation in completion handler

PATCH In review Johan Hovold 2 participants 2 messages Nov 28, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: btusb: fix non-atomic allocation in completion handler

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 <[email protected]> # 5.3
Cc Sean Wang <[email protected]>
---
 drivers/bluetooth/btusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bluetooth/btusb.c +1 -1
index 70e385987d41..b6bf5c195d94 100644
@@ -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;
 		}
Signature · 1 line
2.24.0
maintainer
#1 lore raw

Hi Johan,

Quoted 10 lines

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 <[email protected]> # 5.3
Cc Sean Wang <[email protected]>

---
drivers/bluetooth/btusb.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel