diff mbox series

[03/27] lnet: o2iblnd: fix bug in list_first_entry() change.

Message ID 1623625897-17706-4-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: sync to 2.14.52 | expand

Commit Message

James Simmons June 13, 2021, 11:11 p.m. UTC
From: Mr NeilBrown <neilb@suse.de>

This comparison should be != NULL, else a NULL pointer could be
dereferenced.

Fixes: 4d8bf0c25f10 ("lustre: use list_first_entry() in lnet/klnds subdirectory.")
WC-bug-id: https://jira.whamcloud.com/browse/LU-12678
Lustre-commit: 0024460d797490ae ("LU-12678 o2iblnd: fix bug in list_first_entry() change.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/43558
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/klnds/o2iblnd/o2iblnd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.c b/net/lnet/klnds/o2iblnd/o2iblnd.c
index d670180..d722e6c 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd.c
@@ -1721,7 +1721,7 @@  static void kiblnd_fail_poolset(struct kib_poolset *ps, struct list_head *zombie
 	spin_lock(&ps->ps_lock);
 	while ((po = list_first_entry_or_null(&ps->ps_pool_list,
 					      struct kib_pool,
-					      po_list)) == NULL) {
+					      po_list)) != NULL) {
 		po->po_failed = 1;
 		if (!po->po_allocated)
 			list_move(&po->po_list, zombies);