]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: wacom: use GFP_ATOMIC in wacom_wac_queue_flush()
authorJinmo Yang <jinmo44.yang@gmail.com>
Mon, 1 Jun 2026 13:41:23 +0000 (22:41 +0900)
committerBenjamin Tissoires <bentiss@kernel.org>
Mon, 1 Jun 2026 16:39:07 +0000 (18:39 +0200)
wacom_wac_queue_flush() is called via the .raw_event callback
(wacom_raw_event → wacom_wac_pen_serial_enforce → wacom_wac_queue_flush).
For USB HID devices, this callback is invoked from hid_irq_in(), which
is a URB completion handler running in atomic context. Using GFP_KERNEL
in this path can sleep, leading to a "scheduling while atomic" bug.

Use GFP_ATOMIC instead. The existing code already handles allocation
failure by skipping the fifo entry and continuing.

Reported-by: Sashiko-bot <sashiko-bot@kernel.org>
Fixes: 5e013ad20689 ("HID: wacom: Remove static WACOM_PKGLEN_MAX limit")
Cc: stable@vger.kernel.org
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jinmo Yang <jinmo44.yang@gmail.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/wacom_sys.c

index fac75c2024539ae1936709898fb960af92aa5f5d..3a06be1e163aed9f9b97b4670f6b929f855fbe61 100644 (file)
@@ -76,7 +76,7 @@ static void wacom_wac_queue_flush(struct hid_device *hdev,
                unsigned int count;
                int err;
 
-               buf = kzalloc(size, GFP_KERNEL);
+               buf = kzalloc(size, GFP_ATOMIC);
                if (!buf) {
                        kfifo_skip(fifo);
                        continue;