Skip to content

Commit c46fa89

Browse files
hiqbal-ionosjgunthorpe
authored andcommitted
RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close
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: 6a98d71 ("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>
1 parent 8700af2 commit c46fa89

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/infiniband/ulp/rtrs/rtrs-clt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2771,7 +2771,6 @@ static struct rtrs_clt_sess *alloc_clt(const char *sessname, size_t paths_num,
27712771

27722772
static void free_clt(struct rtrs_clt_sess *clt)
27732773
{
2774-
free_permits(clt);
27752774
free_percpu(clt->pcpu_path);
27762775

27772776
/*
@@ -2893,6 +2892,7 @@ void rtrs_clt_close(struct rtrs_clt_sess *clt)
28932892
rtrs_clt_destroy_path_files(clt_path, NULL);
28942893
kobject_put(&clt_path->kobj);
28952894
}
2895+
free_permits(clt);
28962896
free_clt(clt);
28972897
}
28982898
EXPORT_SYMBOL(rtrs_clt_close);

0 commit comments

Comments
 (0)