summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/mdesc.c
diff options
context:
space:
mode:
authorJag Raman <jag.raman@oracle.com>2017-06-23 14:58:33 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-25 13:43:12 -0700
commit0ab2fcd69dbf1dad27a7cee0f608b48690134ced (patch)
tree66f864d5d0ca29c0dc1c9317f684dc3f1deb745a /arch/sparc/kernel/mdesc.c
parent411cb4a0b3b12833731abc71059a7eeb04dc8477 (diff)
downloadlinux-0ab2fcd69dbf1dad27a7cee0f608b48690134ced.tar.gz
linux-0ab2fcd69dbf1dad27a7cee0f608b48690134ced.tar.bz2
linux-0ab2fcd69dbf1dad27a7cee0f608b48690134ced.zip
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>
Diffstat (limited to 'arch/sparc/kernel/mdesc.c')
-rw-r--r--arch/sparc/kernel/mdesc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index 72aca731657f..f0249691d000 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -205,12 +205,10 @@ static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size)
handle_size = (sizeof(struct mdesc_handle) -
sizeof(struct mdesc_hdr) +
mdesc_size);
+ base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_REPEAT);
+ if (!base)
+ return NULL;
- /*
- * Allocation has to succeed because mdesc update would be missed
- * and such events are not retransmitted.
- */
- base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_NOFAIL);
addr = (unsigned long)base;
addr = (addr + 15UL) & ~15UL;
hp = (struct mdesc_handle *) addr;