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

James Simmons jsimmons at infradead.org
Sun Jun 13 16:11:13 PDT 2021

From: Mr NeilBrown <neilb at suse.de>

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

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 at suse.de>
Reviewed-on: https://review.whamcloud.com/43558
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Signed-off-by: James Simmons <jsimmons at infradead.org>
 net/lnet/klnds/o2iblnd/o2iblnd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
 	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);

More information about the lustre-devel mailing list