linux_dsm_epyc7002/drivers/infiniband/ulp
Gioh Kim 6cbc167bc1 RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats
[ Upstream commit 7ecd7e290bee0ab9cf75b79a367a4cc113cf8292 ]

sess->stats and sess->stats->pcpu_stats objects are freed
when sysfs entry is removed. If something wrong happens and
session is closed before sysfs entry is created,
sess->stats and sess->stats->pcpu_stats objects are not freed.

This patch adds freeing of them at three places:
1. When client uses wrong address and session creation fails.
2. When client fails to create a sysfs entry.
3. When client adds wrong address via sysfs add_path.

Fixes: 215378b838 ("RDMA/rtrs: client: sysfs interface functions")
Link: https://lore.kernel.org/r/20210528113018.52290-21-jinpu.wang@ionos.com
Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:18 +02:00
..
ipoib RDMA/ipoib: Fix warning caused by destroying non-initial netns 2021-06-16 12:01:44 +02:00
iser RDMA: Add rdma_connect_locked() 2020-10-28 09:14:49 -03:00
isert IB/isert: Fix a use after free in isert_connect_request 2021-05-14 09:50:31 +02:00
opa_vnic treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
rtrs RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats 2021-07-14 16:56:18 +02:00
srp RDMA/srp: Fix a recently introduced memory leak 2021-07-14 16:56:17 +02:00
srpt RDMA/srpt: Fix error return code in srpt_cm_req_recv() 2021-05-14 09:50:36 +02:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00