From: John Johansen Date: Wed, 15 Jun 2016 06:57:55 +0000 (+0300) Subject: apparmor: don't check for vmalloc_addr if kvzalloc() failed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=569569adda6ef42493f5dbb69b3c80d8a6bdf514;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git apparmor: don't check for vmalloc_addr if kvzalloc() failed commit 3197f5adf539a3ee6331f433a51483f8c842f890 upstream. Signed-off-by: John Johansen Signed-off-by: Willy Tarreau --- diff --git a/security/apparmor/match.c b/security/apparmor/match.c index 630f325b87a..10d824bc357 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -73,14 +73,14 @@ static struct table_header *unpack_table(char *blob, size_t bsize) u32, be32_to_cpu); else goto fail; + /* if table was vmalloced make sure the page tables are synced + * before it is used, as it goes live to all cpus. + */ + if (is_vmalloc_addr(table)) + vm_unmap_aliases(); } out: - /* if table was vmalloced make sure the page tables are synced - * before it is used, as it goes live to all cpus. - */ - if (is_vmalloc_addr(table)) - vm_unmap_aliases(); return table; fail: kvfree(table);