Re: [PATCH] iio: proximity: hx9023s: Allocate trigger before requesting IRQ
From: Joshua Crofts
Date: Fri Oct 16 2026 - 14:48:32 EST
On Thu, 15 Oct 2026 22:47:35 -0400
Myeonghun Pak <mhun512@xxxxxxxxx> wrote:
> An IRQ handler that already read trigger_enabled can poll data->trig
> after buffer disable. Detaching the virtual IRQ does not join this
> physical IRQ, and trigger deselection can drop the consumer reference.
> Devres may then free the trigger before joining the handler.
>
> Allocate the trigger before requesting the IRQ so devres joins the
> handler before dropping the allocation reference.
>
> This issue was identified as part of our ongoing research while
> reviewing kernel code.
>
> Fixes: 60df548277b7 ("iio: proximity: Add driver support for TYHX's HX9023S capacitive proximity sensor")
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
> ---
LGTM.
Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
--
Kind regards,
Joshua Crofts