Re: [PATCH] nvme: target: rdma: fix ndev refcount leak on queue connect

From: Keith Busch

Date: Wed May 27 2026 - 11:56:31 EST


On Wed, May 27, 2026 at 08:45:44AM +0000, Wentao Liang wrote:
> nvmet_rdma_queue_connect() calls nvmet_rdma_find_get_device() which
> acquires a reference on the returned ndev via kref_get(). On the path
> where the host queue backlog is exceeded and the function returns
> NVME_SC_CONNECT_CTRL_BUSY, reference of ndev is not released, leaking
> the kref.
>
> Fix this by adding a goto to the existing put_device label before the
> early return.

Thanks, applied to nvme-7.2.