diff mbox series

[03/20] lnet: use lnet_md_free in lnet_res_container_cleanup()

Message ID 1592065636-28333-4-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: patches landed for week of June 8 2020 | expand

Commit Message

James Simmons June 13, 2020, 4:26 p.m. UTC
From: NeilBrown <neilb@suse.de>

When we added lnet_md_free(), we should have called it
from lnet_res_container_cleanup() - but that was missed.
Fix it now.

Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: NeilBrown <neilb@suse.de>
---
 net/lnet/lnet/api-ni.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index 7c91800..d6694cb 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -927,12 +927,10 @@  static void lnet_assert_wire_constants(void)
 		struct list_head *e = rec->rec_active.next;
 
 		list_del_init(e);
-		if (rec->rec_type == LNET_COOKIE_TYPE_MD) {
-			kfree(list_entry(e, struct lnet_libmd, md_list));
-
-		} else { /* NB: Active MEs should be attached on portals */
+		if (rec->rec_type == LNET_COOKIE_TYPE_MD)
+			lnet_md_free(list_entry(e, struct lnet_libmd, md_list));
+		else /* NB: Active MEs should be attached on portals */
 			LBUG();
-		}
 		count++;
 	}