Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc64: mdesc: use __GFP_REPEAT action modifier for VM allocation

During MDESC handle allocation, use the __GFP_REPEAT flag instead of
__GFP_NOFAIL. If memory is not available, the caller expects a NULL
pointer instead of waiting until memory is allocated.

Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jag Raman and committed by
David S. Miller
0ab2fcd6 411cb4a0

+3 -5
+3 -5
arch/sparc/kernel/mdesc.c
··· 205 205 handle_size = (sizeof(struct mdesc_handle) - 206 206 sizeof(struct mdesc_hdr) + 207 207 mdesc_size); 208 + base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_REPEAT); 209 + if (!base) 210 + return NULL; 208 211 209 - /* 210 - * Allocation has to succeed because mdesc update would be missed 211 - * and such events are not retransmitted. 212 - */ 213 - base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_NOFAIL); 214 212 addr = (unsigned long)base; 215 213 addr = (addr + 15UL) & ~15UL; 216 214 hp = (struct mdesc_handle *) addr;