Re: [PATCH v2] HID: wacom: avoid copying Bluetooth input reports

From: Jiri Kosina

Date: Mon Jun 29 2026 - 04:55:00 EST


On Wed, 17 Jun 2026, Ruoyu Wang wrote:

> wacom_intuos_bt_irq() duplicates the received Bluetooth report with
> kmemdup() so that it can pass 10-byte input report payloads to the
> common Intuos parser. The helper then copies each payload back into
> wacom->data before calling wacom_intuos_irq().
>
> Avoid the allocation and copy by temporarily pointing wacom->data at the
> current 10-byte payload while the common parser runs, then restoring the
> original report pointer. The Bluetooth report parser keeps using the
> original report buffer for dispatch and battery parsing, while the common
> parser sees the same payload bytes as before.
>
> This also removes the unchecked kmemdup() result from the Bluetooth IRQ
> path.
>
> Suggested-by: Jason Gerecke <jason.gerecke@xxxxxxxxx>
> Signed-off-by: Ruoyu Wang <ruoyuw560@xxxxxxxxx>

Applied, thanks.

--
Jiri Kosina
SUSE Labs