summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/apparmorfs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 0d8dd71f989e..729e595119ed 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -553,8 +553,6 @@ fail2:
553} 553}
554 554
555 555
556#define list_entry_next(pos, member) \
557 list_entry(pos->member.next, typeof(*pos), member)
558#define list_entry_is_head(pos, head, member) (&pos->member == (head)) 556#define list_entry_is_head(pos, head, member) (&pos->member == (head))
559 557
560/** 558/**
@@ -585,7 +583,7 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root,
585 parent = ns->parent; 583 parent = ns->parent;
586 while (ns != root) { 584 while (ns != root) {
587 mutex_unlock(&ns->lock); 585 mutex_unlock(&ns->lock);
588 next = list_entry_next(ns, base.list); 586 next = list_next_entry(ns, base.list);
589 if (!list_entry_is_head(next, &parent->sub_ns, base.list)) { 587 if (!list_entry_is_head(next, &parent->sub_ns, base.list)) {
590 mutex_lock(&next->lock); 588 mutex_lock(&next->lock);
591 return next; 589 return next;
@@ -639,7 +637,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
639 parent = rcu_dereference_protected(p->parent, 637 parent = rcu_dereference_protected(p->parent,
640 mutex_is_locked(&p->ns->lock)); 638 mutex_is_locked(&p->ns->lock));
641 while (parent) { 639 while (parent) {
642 p = list_entry_next(p, base.list); 640 p = list_next_entry(p, base.list);
643 if (!list_entry_is_head(p, &parent->base.profiles, base.list)) 641 if (!list_entry_is_head(p, &parent->base.profiles, base.list))
644 return p; 642 return p;
645 p = parent; 643 p = parent;
@@ -648,7 +646,7 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
648 } 646 }
649 647
650 /* is next another profile in the namespace */ 648 /* is next another profile in the namespace */
651 p = list_entry_next(p, base.list); 649 p = list_next_entry(p, base.list);
652 if (!list_entry_is_head(p, &ns->base.profiles, base.list)) 650 if (!list_entry_is_head(p, &ns->base.profiles, base.list))
653 return p; 651 return p;
654 652