Commit ae3b3165 authored by John Johansen's avatar John Johansen

apparmor: cleanup __find_child()

Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 39d84824
...@@ -397,33 +397,33 @@ struct aa_profile *aa_new_null_profile(struct aa_profile *parent, bool hat, ...@@ -397,33 +397,33 @@ struct aa_profile *aa_new_null_profile(struct aa_profile *parent, bool hat,
/* TODO: profile accounting - setup in remove */ /* 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) * @head: list to search (NOT NULL)
* @name: name of profile (NOT NULL) * @name: name of profile (NOT NULL)
* @len: length of @name substring to match
* *
* Requires: rcu_read_lock be held * Requires: rcu_read_lock be held
* *
* Returns: unrefcounted profile ptr, or NULL if not found * 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) * @head: list to search (NOT NULL)
* @name: name of profile (NOT NULL) * @name: name of profile (NOT NULL)
* @len: length of @name substring to match
* *
* Requires: rcu_read_lock be held * Requires: rcu_read_lock be held
* *
* Returns: unrefcounted profile ptr, or NULL if not found * Returns: unrefcounted profile ptr, or NULL if not found
*/ */
static struct aa_profile *__strn_find_child(struct list_head *head, static struct aa_profile *__find_child(struct list_head *head, const char *name)
const char *name, int len)
{ {
return (struct aa_profile *)__policy_strn_find(head, name, len); return __strn_find_child(head, name, strlen(name));
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment