Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-07-18 08:26:13 +0200
committerJiri Slaby <jslaby@suse.cz>2019-07-18 09:30:37 +0200
commit3b6f57e3a2f885f469a415a73740d60d74079b56 (patch)
treecf250b951c60b3dc3328b3517905b818b88b49f3
parent9d4c0cda8b8d6bd3d3f3171993b21f985d6b005f (diff)
net: rds: fix memory leak in rds_ib_flush_mr_pool
(networking-stable-19_06_09). suse-commit: 15a7753cd5378fa14a8e7dec2decd7bbcb9aae5b
-rw-r--r--net/rds/ib_rdma.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
index 91b53d462fc0..78d5d68cbbce 100644
--- a/net/rds/ib_rdma.c
+++ b/net/rds/ib_rdma.c
@@ -416,12 +416,14 @@ int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
wait_clean_list_grace();
list_to_llist_nodes(pool, &unmap_list, &clean_nodes, &clean_tail);
- if (ibmr_ret)
+ if (ibmr_ret) {
*ibmr_ret = llist_entry(clean_nodes, struct rds_ib_mr, llnode);
-
+ clean_nodes = clean_nodes->next;
+ }
/* more than one entry in llist nodes */
- if (clean_nodes->next)
- llist_add_batch(clean_nodes->next, clean_tail, &pool->clean_list);
+ if (clean_nodes)
+ llist_add_batch(clean_nodes, clean_tail,
+ &pool->clean_list);
}