Skip to content

Commit 595ec19

Browse files
tsautereau-anssitorvalds
authored andcommitted
mm/page_alloc: fix __alloc_size attribute for alloc_pages_exact_nid
The second parameter of alloc_pages_exact_nid is the one indicating the size of memory pointed by the returned pointer. Link: https://lkml.kernel.org/r/YbjEgwhn4bGblp//@coeus Fixes: abd58f3 ("mm/page_alloc: add __alloc_size attributes for better bounds checking") Signed-off-by: Thibaut Sautereau <[email protected]> Acked-by: Kees Cook <[email protected]> Cc: Daniel Micay <[email protected]> Cc: Levente Polyak <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 94ab10d commit 595ec19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/gfp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ extern unsigned long get_zeroed_page(gfp_t gfp_mask);
624624

625625
void *alloc_pages_exact(size_t size, gfp_t gfp_mask) __alloc_size(1);
626626
void free_pages_exact(void *virt, size_t size);
627-
__meminit void *alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask) __alloc_size(1);
627+
__meminit void *alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask) __alloc_size(2);
628628

629629
#define __get_free_page(gfp_mask) \
630630
__get_free_pages((gfp_mask), 0)

0 commit comments

Comments
 (0)