]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selinux: avoid implicit conversions in the netif code
authorChristian Göttsche <cgzones@googlemail.com>
Thu, 6 Jul 2023 13:23:25 +0000 (15:23 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 18 Jul 2023 22:29:48 +0000 (18:29 -0400)
Use the identical type sel_netif_hashfn() returns.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
[PM: subject line tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/netif.c

index adbe9bea2d268259cf491047484942056ce06d74..43a0d3594b725de19132a2d8f76b980030181fc5 100644 (file)
@@ -67,7 +67,7 @@ static inline u32 sel_netif_hashfn(const struct net *ns, int ifindex)
 static inline struct sel_netif *sel_netif_find(const struct net *ns,
                                               int ifindex)
 {
-       int idx = sel_netif_hashfn(ns, ifindex);
+       u32 idx = sel_netif_hashfn(ns, ifindex);
        struct sel_netif *netif;
 
        list_for_each_entry_rcu(netif, &sel_netif_hash[idx], list)
@@ -89,7 +89,7 @@ static inline struct sel_netif *sel_netif_find(const struct net *ns,
  */
 static int sel_netif_insert(struct sel_netif *netif)
 {
-       int idx;
+       u32 idx;
 
        if (sel_netif_total >= SEL_NETIF_HASH_MAX)
                return -ENOSPC;