Repository navigation
Commit 7ecd7e2
RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats
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>1 parent 5b73b79 commit 7ecd7e2
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2765 | 2765 | | |
2766 | 2766 | | |
2767 | 2767 | | |
| 2768 | + | |
| 2769 | + | |
2768 | 2770 | | |
2769 | 2771 | | |
2770 | 2772 | | |
| |||
2773 | 2775 | | |
2774 | 2776 | | |
2775 | 2777 | | |
| 2778 | + | |
| 2779 | + | |
2776 | 2780 | | |
2777 | 2781 | | |
2778 | 2782 | | |
| |||
3048 | 3052 | | |
3049 | 3053 | | |
3050 | 3054 | | |
| 3055 | + | |
| 3056 | + | |
3051 | 3057 | | |
3052 | 3058 | | |
3053 | 3059 | | |
| |||
0 commit comments