summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMd Haris Iqbal <haris.iqbal@ionos.com>2022-02-17 06:09:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-02 13:48:02 +0300
commit27440589551f0f80a0195748550816ca2ed15905 (patch)
treeb05d53539726823b50a71f2938458b5dacaa69c7 /drivers
parentbf2cfad0c6e4b0d1b34d26420fddaf18dc25e56d (diff)
downloadlinux-27440589551f0f80a0195748550816ca2ed15905.tar.xz
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@ionos.com Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com> Reviewed-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/ulp/rtrs/rtrs-clt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index 3272514f0540..a23438bacf12 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -2753,7 +2753,6 @@ err_put:
static void free_clt(struct rtrs_clt *clt)
{
- free_permits(clt);
free_percpu(clt->pcpu_path);
/*
@@ -2869,6 +2868,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);