[PATCH 3/8] mm: enforce return value checking on get_page()

Jan Beulich posted 8 patches 3 years, 6 months ago
[PATCH 3/8] mm: enforce return value checking on get_page()
Posted by Jan Beulich 3 years, 6 months ago
It's hard to imagine a case where an error may legitimately be ignored
here. It's bad enough that in at least one case (set_shadow_status())
the return value was checked only by way of ASSERT()ing.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -61,7 +61,7 @@
 struct page_info;
 
 void put_page(struct page_info *);
-bool get_page(struct page_info *, const struct domain *);
+bool __must_check get_page(struct page_info *, const struct domain *);
 struct domain *__must_check page_get_owner_and_reference(struct page_info *);
 
 /* Boot-time allocator. Turns into generic allocator after bootstrap. */
Re: [PATCH 3/8] mm: enforce return value checking on get_page()
Posted by Julien Grall 3 years, 6 months ago
Hi Jan,

On 26/07/2022 17:04, Jan Beulich wrote:
> It's hard to imagine a case where an error may legitimately be ignored
> here. It's bad enough that in at least one case (set_shadow_status())
> the return value was checked only by way of ASSERT()ing.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall