diff mbox

[06/14] UBUNTU: SAUCE: apparmor: fix: don't check for vmalloc_addr if kvzalloc() failed

Message ID 1471943154-14507-7-git-send-email-john.johansen@canonical.com
State New
Headers show

Commit Message

John Johansen Aug. 23, 2016, 9:05 a.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1615885

Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 security/apparmor/match.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 68e4a26..4a42264 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -102,14 +102,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);