diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-03-10 13:24:24 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-03-10 13:24:24 +1100 |
commit | 7f36522fa5c8192dccee0f0a414f1b7b336b9c87 (patch) | |
tree | 443ab002a359443792f43c48790e91539a01e4d4 /security/apparmor/lib.c | |
parent | bab31490ee78b5c5531bae6d54d411a49d2c2f30 (diff) | |
parent | 28415881a8fced951563443d0a95f9f14cea8687 (diff) |
Merge branch 'akpm/master'
Diffstat (limited to 'security/apparmor/lib.c')
-rw-r--r-- | security/apparmor/lib.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c index 66475bda6f72..1a13494bc7c7 100644 --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c @@ -129,36 +129,6 @@ void aa_info_message(const char *str) } /** - * __aa_kvmalloc - do allocation preferring kmalloc but falling back to vmalloc - * @size: how many bytes of memory are required - * @flags: the type of memory to allocate (see kmalloc). - * - * Return: allocated buffer or NULL if failed - * - * It is possible that policy being loaded from the user is larger than - * what can be allocated by kmalloc, in those cases fall back to vmalloc. - */ -void *__aa_kvmalloc(size_t size, gfp_t flags) -{ - void *buffer = NULL; - - if (size == 0) - return NULL; - - /* do not attempt kmalloc if we need more than 16 pages at once */ - if (size <= (16*PAGE_SIZE)) - buffer = kmalloc(size, flags | GFP_KERNEL | __GFP_NORETRY | - __GFP_NOWARN); - if (!buffer) { - if (flags & __GFP_ZERO) - buffer = vzalloc(size); - else - buffer = vmalloc(size); - } - return buffer; -} - -/** * aa_policy_init - initialize a policy structure * @policy: policy to initialize (NOT NULL) * @prefix: prefix name if any is required. (MAYBE NULL) |