Repository navigation
Commit 6cbc167
RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats
[ Upstream commit 7ecd7e2 ]
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: 215378b ("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>1 parent 6569ae1 commit 6cbc167
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2706 | 2706 | | |
2707 | 2707 | | |
2708 | 2708 | | |
| 2709 | + | |
| 2710 | + | |
2709 | 2711 | | |
2710 | 2712 | | |
2711 | 2713 | | |
| |||
2714 | 2716 | | |
2715 | 2717 | | |
2716 | 2718 | | |
| 2719 | + | |
| 2720 | + | |
2717 | 2721 | | |
2718 | 2722 | | |
2719 | 2723 | | |
| |||
2973 | 2977 | | |
2974 | 2978 | | |
2975 | 2979 | | |
| 2980 | + | |
| 2981 | + | |
2976 | 2982 | | |
2977 | 2983 | | |
2978 | 2984 | | |
| |||
0 commit comments