:p
atchew
Login
This patch fixes two `sparse` warnings: net/core/neighbour.c:453:9: warning: context imbalance in '__neigh_ifdown' - wrong count at exit net/core/neighbour.c:871:9: warning: context imbalance in 'pneigh_ifdown_and_unlock' - unexpected unlock You can check it by running: `make C=1 net/core/neighbour.o` Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com> --- net/core/neighbour.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index XXXXXXX..XXXXXXX 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -XXX,XX +XXX,XX @@ EXPORT_SYMBOL(neigh_changeaddr); static int __neigh_ifdown(struct neigh_table *tbl, struct net_device *dev, bool skip_perm) + __acquires(&tbl->lock) { write_lock_bh(&tbl->lock); neigh_flush_dev(tbl, dev, skip_perm); @@ -XXX,XX +XXX,XX @@ static int __neigh_ifdown(struct neigh_table *tbl, struct net_device *dev, } int neigh_carrier_down(struct neigh_table *tbl, struct net_device *dev) + __acquires(&tbl->lock) { __neigh_ifdown(tbl, dev, true); return 0; @@ -XXX,XX +XXX,XX @@ int neigh_carrier_down(struct neigh_table *tbl, struct net_device *dev) EXPORT_SYMBOL(neigh_carrier_down); int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev) + __acquires(&tbl->lock) { __neigh_ifdown(tbl, dev, false); return 0; @@ -XXX,XX +XXX,XX @@ int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *pkey, static int pneigh_ifdown_and_unlock(struct neigh_table *tbl, struct net_device *dev) + __releases(&tbl->lock) { struct pneigh_entry *n, **np, *freelist = NULL; u32 h; -- 2.46.1
This patch fixes two sparse warnings (`make C=1`): net/ipv6/icmp.c:103:20: warning: context imbalance in 'icmpv6_xmit_lock' - wrong count at exit net/ipv6/icmp.c:119:13: warning: context imbalance in 'icmpv6_xmit_unlock' - unexpected unlock Since `icmp6_xmit_lock()` and `icmp6_xmit_unlock()` are designed as they are named, entering/returning the function without lock/unlock doesn't matter. Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com> --- net/ipv6/icmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index XXXXXXX..XXXXXXX 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -XXX,XX +XXX,XX @@ static const struct inet6_protocol icmpv6_protocol = { /* Called with BH disabled */ static struct sock *icmpv6_xmit_lock(struct net *net) + __acquires(&sk->sk_lock.slock) { struct sock *sk; @@ -XXX,XX +XXX,XX @@ static struct sock *icmpv6_xmit_lock(struct net *net) } static void icmpv6_xmit_unlock(struct sock *sk) + __releases(&sk->sk_lock.slock) { sock_net_set(sk, &init_net); spin_unlock(&sk->sk_lock.slock); -- 2.46.1