Explorar o código

security/keys/keyctl.c: suppress memory allocation failure warning

This allocation may be large.  The code is probing to see if it will
succeed and if not, it falls back to vmalloc().  We should suppress any
page-allocation failure messages when the fallback happens.

Reported-by: Dave Jones <davej@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andrew Morton %!s(int64=13) %!d(string=hai) anos
pai
achega
4f1c28d241
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      security/keys/keyctl.c

+ 1 - 1
security/keys/keyctl.c

@@ -84,7 +84,7 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type,
 	vm = false;
 	vm = false;
 	if (_payload) {
 	if (_payload) {
 		ret = -ENOMEM;
 		ret = -ENOMEM;
-		payload = kmalloc(plen, GFP_KERNEL);
+		payload = kmalloc(plen, GFP_KERNEL | __GFP_NOWARN);
 		if (!payload) {
 		if (!payload) {
 			if (plen <= PAGE_SIZE)
 			if (plen <= PAGE_SIZE)
 				goto error2;
 				goto error2;