Skip to content

Commit bbe1e55

Browse files
omnijgregkh
authored andcommitted
HID: wacom: use GFP_ATOMIC in wacom_wac_queue_flush()
commit 55f1ad5 upstream. 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: 5e013ad ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ca899a9 commit bbe1e55

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hid/wacom_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void wacom_wac_queue_flush(struct hid_device *hdev,
7676
unsigned int count;
7777
int err;
7878

79-
buf = kzalloc(size, GFP_KERNEL);
79+
buf = kzalloc(size, GFP_ATOMIC);
8080
if (!buf) {
8181
kfifo_skip(fifo);
8282
continue;

0 commit comments

Comments
 (0)