Re: [PATCH v2 1/7] HID: sensor: hub: Synchronize callback removal with raw events

From: Joshua Crofts

Date: Thu Nov 05 2026 - 05:07:46 EST


On Wed, 4 Nov 2026 12:13:57 -0800
Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx> wrote:

> Raw-event processing holds pdata->lock across callback lookup and
> invocation, and takes dyn_callback_lock during lookup. Removal must
> prevent both active callbacks and future lookups before client state can
> be released.
>
> Take pdata->lock before dyn_callback_lock, matching raw-event order,
> and unlink the callback while holding both locks. This ensures active
> raw-event callbacks have finished and prevents future lookups.
>
> Fixes: 401ca24fb34a ("HID: sensors: introduce sensor framework")
> Reported-by: Семён Марьясин <simeon@xxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@xxxxxxxxxxxxxx/
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
> ---

Reviewed-by: Joshua Crofts <crofts@xxxxxxxxxx>

--
Kind regards,
Joshua Crofts