diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2025-03-18 09:33:30 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2025-04-11 16:29:51 -0400 |
commit | e6fb56b2253d49d192d4fe790698462d5422c041 (patch) | |
tree | 80a00d8a04d6f74e0ffed49ccbea27c1545aafe1 /security/selinux/netport.c | |
parent | 9cc034be10a52c30719f8b9436d81b981421bfb7 (diff) |
selinux: add likely hints for fast paths
In the network hashtable lookup code add likely() compiler hints in the
fast path, like already done in sel_netif_sid().
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/netport.c')
-rw-r--r-- | security/selinux/netport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/netport.c b/security/selinux/netport.c index 2e22ad9c2bd0..7d2207384d40 100644 --- a/security/selinux/netport.c +++ b/security/selinux/netport.c @@ -186,7 +186,7 @@ int sel_netport_sid(u8 protocol, u16 pnum, u32 *sid) rcu_read_lock(); port = sel_netport_find(protocol, pnum); - if (port != NULL) { + if (likely(port != NULL)) { *sid = port->psec.sid; rcu_read_unlock(); return 0; |