Re: [PATCH v2] RDMA/srpt: Fix srpt_alloc_rw_ctxs() unwind counters
From: Leon Romanovsky
Date: Thu Jul 16 2026 - 04:58:00 EST
On Wed, 15 Jul 2026 18:15:50 +0800, kensanya@xxxxxxx wrote:
> When srpt_alloc_rw_ctxs() fails partway through a multi-buffer indirect
> descriptor, the unwind path destroys RDMA contexts but leaves stale
> n_rw_ctx and n_rdma values (and a dangling rw_ctxs pointer). Later
> sq_wr_avail accounting in srpt_queue_response() or srpt_write_pending()
> can then subtract the wrong number of send queue credits.
>
> Reset the counters and clear rw_ctxs after freeing the heap
> allocation before returning an error.
>
> [...]
Applied, thanks!
[1/1] RDMA/srpt: Fix srpt_alloc_rw_ctxs() unwind counters
https://git.kernel.org/rdma/rdma/c/91997e188f68af
Best regards,
--
Leon Romanovsky <leon@xxxxxxxxxx>