Re: [PATCH 05/26] Input: maplecontrol - stop polling and clear callback on close
From: sashiko-bot@kernel.org
Date: 2026-07-04 06:07:01
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Pre-existing issues: - [High] The event reporting loop in `dc_pad_callback()` does not call `input_sync()` after reporting a group of input events. -- commit 5b43e607496d623e78583ef58f7527944fe7a924 Author: Dmitry Torokhov [off-list ref] Input: maplecontrol - stop polling and clear callback on close In dc_pad_close(), pass NULL instead of dc_pad_callback to maple_getcond_callback() to both stop polling and clear the callback pointer when the input device is closed.
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index a498fc322c4d5..c66b2614e2982 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c@@ -74,8 +74,7 @@ static void dc_pad_close(struct input_dev *dev) { struct dc_pad *pad = dev_get_platdata(&dev->dev); - maple_getcond_callback(pad->mdev, dc_pad_callback, 0, - MAPLE_FUNC_CONTROLLER); + maple_getcond_callback(pad->mdev, NULL, 0, MAPLE_FUNC_CONTROLLER); }
[Severity: High]
This isn't a bug introduced by this patch, but since dc_pad_callback() is
involved here, is there a missing call to input_sync()?
Looking at dc_pad_callback(), it reports several events without ever flushing
them:
drivers/input/joystick/maplecontrol.c:dc_pad_callback() {
...
input_report_abs(dev, ABS_RX, res[14]);
input_report_abs(dev, ABS_RY, res[15]);
}
Without input_sync(), EV_SYN/SYN_REPORT events are never generated.
Will this prevent the input core from waking up userspace readers (like
evdev), causing reported events to be indefinitely buffered until the buffer
overflows?
Since maple_dma_handler calls dc_pad_callback() on every data transfer to
report new joystick states, does this omission break event propagation and
make the joystick unresponsive for applications relying on poll() or blocking
read()?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260703-b4-maple-cleanup-v1-0-41e424964da5@gmail.com?part=5