Browse Source

apparmor: don't check for vmalloc_addr if kvzalloc() failed

Signed-off-by: John Johansen <john.johansen@canonical.com>
John Johansen 9 years ago
parent
commit
3197f5adf5
1 changed files with 5 additions and 5 deletions
  1. 5 5
      security/apparmor/match.c

+ 5 - 5
security/apparmor/match.c

@@ -75,14 +75,14 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
 				     u32, be32_to_cpu);
 				     u32, be32_to_cpu);
 		else
 		else
 			goto fail;
 			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:
 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;
 	return table;
 fail:
 fail:
 	kvfree(table);
 	kvfree(table);