diff mbox series

[1/2] swap: Cleanup duplicated WARN_ON in add_to_avail_list

Message ID 20230627120833.2230766-2-mawupeng1@huawei.com (mailing list archive)
State New
Headers show
Series fix WARN_ON in add_to_avail_list | expand

Commit Message

mawupeng June 27, 2023, 12:08 p.m. UTC
From: Ma Wupeng <mawupeng1@huawei.com>

Empty check for plist_node is checked in add_to_avail_list and plist_add.
Drop the duplicate one in add_to_avail_list.

Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
---
 mm/swapfile.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 274bbf797480..879cb80bf37b 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -713,10 +713,8 @@  static void add_to_avail_list(struct swap_info_struct *p)
 	int nid;
 
 	spin_lock(&swap_avail_lock);
-	for_each_node(nid) {
-		WARN_ON(!plist_node_empty(&p->avail_lists[nid]));
+	for_each_node(nid)
 		plist_add(&p->avail_lists[nid], &swap_avail_heads[nid]);
-	}
 	spin_unlock(&swap_avail_lock);
 }