Linux-mediatek Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] Bluetooth: btusb: fix non-atomic allocation in completion handler
@ 2019-11-28 18:24 Johan Hovold
  2019-11-28 18:28 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2019-11-28 18:24 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg
  Cc: Sean Wang, linux-kernel, stable, Johan Hovold, linux-bluetooth,
	linux-mediatek, Matthias Brugger

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>
---
 drivers/bluetooth/btusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 70e385987d41..b6bf5c195d94 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -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;
 		}
-- 
2.24.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: btusb: fix non-atomic allocation in completion handler
  2019-11-28 18:24 [PATCH] Bluetooth: btusb: fix non-atomic allocation in completion handler Johan Hovold
@ 2019-11-28 18:28 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-11-28 18:28 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Johan Hedberg, Sean Wang, lkml, stable, Bluez mailing list,
	linux-mediatek, Matthias Brugger

Hi Johan,

> 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>
> ---
> drivers/bluetooth/btusb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-28 18:24 [PATCH] Bluetooth: btusb: fix non-atomic allocation in completion handler Johan Hovold
2019-11-28 18:28 ` Marcel Holtmann

Linux-mediatek Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mediatek/0 linux-mediatek/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mediatek linux-mediatek/ https://lore.kernel.org/linux-mediatek \
		linux-mediatek@lists.infradead.org
	public-inbox-index linux-mediatek

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mediatek


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git