Patch "RDMA/core: Fix GID entry ref leak when create_ah fails" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    RDMA/core: Fix GID entry ref leak when create_ah fails

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-core-fix-gid-entry-ref-leak-when-create_ah-fail.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0f2666bc048abdddc9d09501d990c3b088b68a63
Author: Saravanan Vajravel <saravanan.vajravel@xxxxxxxxxxxx>
Date:   Fri Mar 31 23:34:24 2023 -0700

    RDMA/core: Fix GID entry ref leak when create_ah fails
    
    [ Upstream commit aca3b0fa3d04b40c96934d86cc224cccfa7ea8e0 ]
    
    If AH create request fails, release sgid_attr to avoid GID entry
    referrence leak reported while releasing GID table
    
    Fixes: 1a1f460ff151 ("RDMA: Hold the sgid_attr inside the struct ib_ah/qp")
    Link: https://lore.kernel.org/r/20230401063424.342204-1-saravanan.vajravel@xxxxxxxxxxxx
    Reviewed-by: Selvin Xavier <selvin.xavier@xxxxxxxxxxxx>
    Signed-off-by: Saravanan Vajravel <saravanan.vajravel@xxxxxxxxxxxx>
    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 11b1c1603aeb4..b99b3cc283b65 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -532,6 +532,8 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
 	else
 		ret = device->ops.create_ah(ah, &init_attr, NULL);
 	if (ret) {
+		if (ah->sgid_attr)
+			rdma_put_gid_attr(ah->sgid_attr);
 		kfree(ah);
 		return ERR_PTR(ret);
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux