diff options
author | Paul Moore <paul@paul-moore.com> | 2022-01-27 10:56:13 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2022-02-01 19:08:28 -0500 |
commit | 0e326df069802dc48e4f095f889cb780e4beaba6 (patch) | |
tree | ce81cfb714f72eb8081c13dfc5ebd60342cb5106 /security/selinux/netnode.c | |
parent | 6bc1968c14e91e03c0851b9c5c5330d91305a853 (diff) | |
download | linux-0e326df069802dc48e4f095f889cb780e4beaba6.tar.gz |
selinux: various sparse fixes
When running the SELinux code through sparse, there are a handful of
warnings. This patch resolves some of these warnings caused by
"__rcu" mismatches.
% make W=1 C=1 security/selinux/
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/netnode.c')
-rw-r--r-- | security/selinux/netnode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c index 889552db0d31..0ac7df9a9367 100644 --- a/security/selinux/netnode.c +++ b/security/selinux/netnode.c @@ -164,8 +164,9 @@ static void sel_netnode_insert(struct sel_netnode *node) if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) { struct sel_netnode *tail; tail = list_entry( - rcu_dereference_protected(sel_netnode_hash[idx].list.prev, - lockdep_is_held(&sel_netnode_lock)), + rcu_dereference_protected( + list_tail_rcu(&sel_netnode_hash[idx].list), + lockdep_is_held(&sel_netnode_lock)), struct sel_netnode, list); list_del_rcu(&tail->list); kfree_rcu(tail, rcu); |