Re: [PATCH 1/2] RDMA/cxgb4: Cancel reg_work before freeing device on remove
From: Jason Gunthorpe
Date: Tue Aug 11 2026 - 16:03:59 EST
On Thu, Aug 06, 2026 at 01:01:27PM +0000, Fan Wu wrote:
> c4iw_uld_state_change() queues reg_work to register the RDMA device.
> c4iw_remove() can free ctx->dev while this work is pending or running,
> leaving c4iw_register_device() accessing the freed device.
>
> Cancel reg_work before removing the device. The registration work can
> tear down ctx->dev when registration fails, so do not unregister or
> deallocate it again in that case.
>
> This issue was found by an in-house static analysis tool.
>
> Fixes: 1c8f1da5d851 ("iw_cxgb4: Fix possible circular dependency locking warning")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: Codex:gpt-5.6
> Signed-off-by: Fan Wu <fanwu01@xxxxxxxxxx>
> ---
> drivers/infiniband/hw/cxgb4/device.c | 6 ++++++
> 1 file changed, 6 insertions(+)
applied thanks, the sashiko review also noted a number of pre-existing
issues that seem easy to fix
Jason