Re: [PATCH] scsi: elx: efct: fix refcount leak in efct_hw_io_abort()
From: Daniel Wagner
Date: Mon Jun 15 2026 - 05:35:42 EST
On Thu, Jun 11, 2026 at 01:30:37PM +0800, WenTao Liang wrote:
> When efct_hw_reqtag_alloc() fails in efct_hw_io_abort(), the error
> path returns -ENOSPC without releasing the reference obtained via
> kref_get_unless_zero() earlier in the function. All other error
> paths correctly drop the reference. This causes a permanent
> reference leak on the io_to_abort object.
>
> Additionally, the abort_in_progress flag is left set to true on
> this path, which means future abort attempts for the same I/O will
> immediately return -EINPROGRESS even though the abort was never
> submitted, effectively blocking recovery.
>
> Fix this by adding the missing kref_put() call and reset
> abort_in_progress to false, matching the cleanup done in the
> efct_hw_wq_write() failure path below.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 63de51327a64 ("scsi: elx: efct: Hardware I/O and SGL initialization")
> Signed-off-by: WenTao Liang <vulab@xxxxxxxxxxx>
Looks good to me.
Reviewed-by: Daniel Wagner <dwagner@xxxxxxx>