Patch "RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close" has been added to the 5.10-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/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close

to the 5.10-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-rtrs-clt-move-free_permit-from-free_clt-to-rtrs.patch
and it can be found in the queue-5.10 subdirectory.

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



commit a77c0172ca90402b741845c88556be58012cbaf1
Author: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
Date:   Thu Feb 17 04:09:29 2022 +0100

    RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close
    
    [ Upstream commit c46fa8911b17e3f808679061a8af8bee219f4602 ]
    
    Error path of rtrs_clt_open() calls free_clt(), where free_permit is
    called.  This is wrong since error path of rtrs_clt_open() does not need
    to call free_permit().
    
    Also, moving free_permits() call to rtrs_clt_close(), makes it more
    aligned with the call to alloc_permit() in rtrs_clt_open().
    
    Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
    Link: https://lore.kernel.org/r/20220217030929.323849-2-haris.iqbal@xxxxxxxxx
    Signed-off-by: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
    Reviewed-by: Jack Wang <jinpu.wang@xxxxxxxxx>
    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index 5a3c11b0b3102..13634eda833de 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -2638,7 +2638,6 @@ static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num,
 
 static void free_clt(struct rtrs_clt *clt)
 {
-	free_permits(clt);
 	free_percpu(clt->pcpu_path);
 
 	/*
@@ -2759,6 +2758,7 @@ void rtrs_clt_close(struct rtrs_clt *clt)
 		rtrs_clt_destroy_sess_files(sess, NULL);
 		kobject_put(&sess->kobj);
 	}
+	free_permits(clt);
 	free_clt(clt);
 }
 EXPORT_SYMBOL(rtrs_clt_close);



[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