[PATCH] mm: Revert IS_ERR_OR_NULL check

From: Matthew Wilcox (Oracle)
Date: Mon Nov 18 2024 - 23:32:25 EST


&foo->bar is address arithmetic, not a dereference of foo.
Huawei engineers seem particularly prone to not knowing this.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
mm/ksm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/ksm.c b/mm/ksm.c
index 7ac59cde626c..31a9bc365437 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2261,8 +2261,7 @@ static void cmp_and_merge_page(struct page *page, struct ksm_rmap_item *rmap_ite

/* Start by searching for the folio in the stable tree */
kfolio = stable_tree_search(page);
- if (!IS_ERR_OR_NULL(kfolio) && &kfolio->page == page &&
- rmap_item->head == stable_node) {
+ if (&kfolio->page == page && rmap_item->head == stable_node) {
folio_put(kfolio);
return;
}
--
2.45.2