Re: [PATCH v2] RDMA/cxgb4: Use dealloc_driver op to fix ioremap leak on alloc failure

From: Leon Romanovsky

Date: Tue Dec 01 2026 - 14:02:00 EST



On Thu, 26 Nov 2026 20:08:41 +0300, Serhat Kumral wrote:
> In c4iw_alloc(), if c4iw_rdev_open() fails, the previously ioremapped
> BAR2/on-chip memory (bar2_kva / oc_mw_kva) is leaked because
> ib_dealloc_device() does not unmap it.
>
> Refactor c4iw_dealloc() to take struct ib_device * and register it as the
> .dealloc_driver callback in c4iw_dev_ops. Move ib_set_device_ops() and
> the xarray/mutex/waitqueue initializations earlier in c4iw_alloc() so
> that all ib_dealloc_device() error paths invoke c4iw_dealloc(). Guard
> c4iw_rdev_close() with dev->rdev.free_workq so it is only called when
> c4iw_rdev_open() succeeded.
>
> [...]

Applied, thanks!

[1/1] RDMA/cxgb4: Use dealloc_driver op to fix ioremap leak on alloc failure
https://git.kernel.org/rdma/rdma/c/3a1a51eef83971

Best regards,
--
Leon Romanovsky <leon@xxxxxxxxxx>