]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
apparmor: cleanup __find_child()
authorJohn Johansen <john.johansen@canonical.com>
Fri, 2 Jun 2017 20:50:22 +0000 (13:50 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Sun, 11 Jun 2017 00:11:31 +0000 (17:11 -0700)
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/policy.c

index 65e98d0491f48ae6297be53972b13f81eac312cc..0a99e5324da07bc9c81d81ec410c2fd319c845e7 100644 (file)
@@ -397,33 +397,33 @@ fail:
 /* TODO: profile accounting - setup in remove */
 
 /**
- * __find_child - find a profile on @head list with a name matching @name
+ * __strn_find_child - find a profile on @head list using substring of @name
  * @head: list to search  (NOT NULL)
  * @name: name of profile (NOT NULL)
+ * @len: length of @name substring to match
  *
  * Requires: rcu_read_lock be held
  *
  * Returns: unrefcounted profile ptr, or NULL if not found
  */
-static struct aa_profile *__find_child(struct list_head *head, const char *name)
+static struct aa_profile *__strn_find_child(struct list_head *head,
+                                           const char *name, int len)
 {
-       return (struct aa_profile *)__policy_find(head, name);
+       return (struct aa_profile *)__policy_strn_find(head, name, len);
 }
 
 /**
- * __strn_find_child - find a profile on @head list using substring of @name
+ * __find_child - find a profile on @head list with a name matching @name
  * @head: list to search  (NOT NULL)
  * @name: name of profile (NOT NULL)
- * @len: length of @name substring to match
  *
  * Requires: rcu_read_lock be held
  *
  * Returns: unrefcounted profile ptr, or NULL if not found
  */
-static struct aa_profile *__strn_find_child(struct list_head *head,
-                                           const char *name, int len)
+static struct aa_profile *__find_child(struct list_head *head, const char *name)
 {
-       return (struct aa_profile *)__policy_strn_find(head, name, len);
+       return __strn_find_child(head, name, strlen(name));
 }
 
 /**