From: Christian Göttsche Date: Thu, 6 Jul 2023 13:23:25 +0000 (+0200) Subject: selinux: avoid implicit conversions in the netif code X-Git-Tag: v6.6-rc1~148^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=777ea29c57a078679fdb637919c1794d0d244128;p=thirdparty%2Fkernel%2Flinux.git selinux: avoid implicit conversions in the netif code Use the identical type sel_netif_hashfn() returns. Signed-off-by: Christian Göttsche [PM: subject line tweaks] Signed-off-by: Paul Moore --- diff --git a/security/selinux/netif.c b/security/selinux/netif.c index adbe9bea2d268..43a0d3594b725 100644 --- a/security/selinux/netif.c +++ b/security/selinux/netif.c @@ -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;