Linux 6.9-rc4
[sfrench/cifs-2.6.git] / security / selinux / netif.c
index 86813b46fad5f54c41d88f016b6f7af2064cc152..43a0d3594b725de19132a2d8f76b980030181fc5 100644 (file)
@@ -36,7 +36,6 @@ struct sel_netif {
 };
 
 static u32 sel_netif_total;
-static LIST_HEAD(sel_netif_list);
 static DEFINE_SPINLOCK(sel_netif_lock);
 static struct list_head sel_netif_hash[SEL_NETIF_HASH_SIZE];
 
@@ -68,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)
@@ -90,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;
@@ -154,7 +153,7 @@ static int sel_netif_sid_slow(struct net *ns, int ifindex, u32 *sid)
                goto out;
        }
 
-       ret = security_netif_sid(&selinux_state, dev->name, sid);
+       ret = security_netif_sid(dev->name, sid);
        if (ret != 0)
                goto out;
        new = kzalloc(sizeof(*new), GFP_ATOMIC);