linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/proc/kcore.c: Pass a pointer to virt_addr_valid()
@ 2022-08-29 13:13 Linus Walleij
  2022-08-29 15:18 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2022-08-29 13:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, Linus Walleij

The virt_addr_valid() should be passed a pointer, the current
code passing a long unsigned int is just exploiting the
unintentional polymorphism of these calls being implemented
as preprocessor macros.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 fs/proc/kcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index dff921f7ca33..f358960b7a1f 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -200,7 +200,7 @@ kclist_add_private(unsigned long pfn, unsigned long nr_pages, void *arg)
 	ent->addr = (unsigned long)page_to_virt(p);
 	ent->size = nr_pages << PAGE_SHIFT;
 
-	if (!virt_addr_valid(ent->addr))
+	if (!virt_addr_valid((void *)ent->addr))
 		goto free_out;
 
 	/* cut not-mapped area. ....from ppc-32 code. */
-- 
2.37.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-29 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29 13:13 [PATCH] fs/proc/kcore.c: Pass a pointer to virt_addr_valid() Linus Walleij
2022-08-29 15:18 ` Matthew Wilcox
2022-08-29 21:03   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox