Re: [PATCH] RDMA/hfi1: fix init_one() probe failure cleanup

From: Leon Romanovsky

Date: Wed Jul 08 2026 - 06:59:01 EST


On Mon, Jul 06, 2026 at 10:34:24PM +0800, Dawei Feng wrote:
> On Sun, 5 Jul 2026 15:23:28 +0300, Leon Romanovsky wrote:
> >Just move hfi1_validate_rcvhdrcnt() to be before hfi1_alloc_devdata()
> >and remove error prints.
>
> Hi, Leon,
>
> I agree that this approach is suitable for the hfi1_validate_rcvhdrcnt()
> failure path. However, it is not generally applicable to the other failure
> paths. The later failures still occur after hfi1_alloc_devdata(), so they
> still need proper cleanup handling to avoid leaking the allocated devdata.
> Therefore, I think the current approach may be more appropriate for this
> fix.

https://lore.kernel.org/all/20260708-clean-init-one-hfi1-v1-0-b9e9641268a5@xxxxxxxxxx/

Thanks