diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-10 15:34:12 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 11:46:57 -0500 |
commit | 8d64124a6a93ec68fda6f781e48a7b95d9dd17d9 (patch) | |
tree | 476ac17aa35c5a38bd0a999d0b1e7e5b076e1fb0 /security | |
parent | a10d7c22b34bcf744679019269bfb33ebf0b75ee (diff) |
selinux; don't open-code a loop in sb_finish_set_opts()
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/hooks.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 59b164d7134d..630fe8883957 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -571,10 +571,9 @@ static int sb_finish_set_opts(struct super_block *sb) | |||
571 | during get_sb by a pseudo filesystem that directly | 571 | during get_sb by a pseudo filesystem that directly |
572 | populates itself. */ | 572 | populates itself. */ |
573 | spin_lock(&sbsec->isec_lock); | 573 | spin_lock(&sbsec->isec_lock); |
574 | next_inode: | 574 | while (!list_empty(&sbsec->isec_head)) { |
575 | if (!list_empty(&sbsec->isec_head)) { | ||
576 | struct inode_security_struct *isec = | 575 | struct inode_security_struct *isec = |
577 | list_entry(sbsec->isec_head.next, | 576 | list_first_entry(&sbsec->isec_head, |
578 | struct inode_security_struct, list); | 577 | struct inode_security_struct, list); |
579 | struct inode *inode = isec->inode; | 578 | struct inode *inode = isec->inode; |
580 | list_del_init(&isec->list); | 579 | list_del_init(&isec->list); |
@@ -586,7 +585,6 @@ next_inode: | |||
586 | iput(inode); | 585 | iput(inode); |
587 | } | 586 | } |
588 | spin_lock(&sbsec->isec_lock); | 587 | spin_lock(&sbsec->isec_lock); |
589 | goto next_inode; | ||
590 | } | 588 | } |
591 | spin_unlock(&sbsec->isec_lock); | 589 | spin_unlock(&sbsec->isec_lock); |
592 | out: | 590 | out: |