Re: [PATCH v3] iio: trigger: use put_device() in viio_trigger_alloc() error path
From: Salah Triki
Date: Mon Feb 16 2026 - 03:45:58 EST
Hi Andy,
You are absolutely right. My previous version (v3) was logically flawed as
it could trigger the release callback before the necessary fields were
initialized, leading to an unsafe irq_free_descs() call.
Since I don't have the physical hardware to perform runtime injection
tests,I relied on manual code path analysis and clearly failed to account
for the side effects of put_device().
I'm sending a v4 which takes the safer approach: moving
device_initialize() after all potential failure points. This way, we can
safely use kfree() and irq_free_descs() in the error path without
involving the device lifecycle prematurely.
Thank you for the catch.