Re: [PATCH v3 0/3] iio: hid-sensors: fix shared callbacks in temperature and humidity

From: Jonathan Cameron

Date: Sun Nov 01 2026 - 19:38:43 EST


On Sun, 18 Oct 2026 19:34:17 -0700
Christopher Hoover <ch@xxxxxxxxxxxxxx> wrote:

> hid-sensor-temperature and hid-sensor-humidity share one static
> struct hid_sensor_hub_callbacks across instances and overwrite its pdev
> on every probe. With two temperature sensors, reports for one go to
> the other's pdev; once that device is removed,
> temperature_capture_sample() dereferences NULL. I hit this on 7.0
> with two uhid-created sensors.
>
> Patches 2-3 make the callbacks per instance, as the other HID sensor
> drivers do. Patch 1 makes sensor_hub_remove_callback() take
> pdata->lock, as sensor_hub_raw_event() does, so a report racing an
> unbind cannot call through the freed callbacks.
I know Srinivas is just back from holiday, but though I'd just ping this
one as waiting on him taking another look!

Thanks,

Jonathan