Commit 1f78d9f9 authored by Hannes Eder's avatar Hannes Eder Committed by David S. Miller

drivers/net/bonding: fix sparse warnings: context imbalance

Impact: Attribute functions with __acquires(...) and/or __releases(...).

Fix this sparse warnings:
  drivers/net/bonding/bond_alb.c:1675:9: warning: context imbalance in 'bond_alb_handle_active_change' - unexpected unlock
  drivers/net/bonding/bond_alb.c:1742:9: warning: context imbalance in 'bond_alb_set_mac_address' - unexpected unlock
  drivers/net/bonding/bond_main.c:1025:17: warning: context imbalance in 'bond_do_fail_over_mac' - unexpected unlock
  drivers/net/bonding/bond_main.c:3195:13: warning: context imbalance in 'bond_info_seq_start' - wrong count at exit
  drivers/net/bonding/bond_main.c:3234:13: warning: context imbalance in 'bond_info_seq_stop' - unexpected unlock
Signed-off-by: default avatarHannes Eder <hannes@hanneseder.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b79d8fff
...@@ -1628,6 +1628,10 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char ...@@ -1628,6 +1628,10 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char
* no other locks may be held. * no other locks may be held.
*/ */
void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave) void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave)
__releases(&bond->curr_slave_lock)
__releases(&bond->lock)
__acquires(&bond->lock)
__acquires(&bond->curr_slave_lock)
{ {
struct slave *swap_slave; struct slave *swap_slave;
int i; int i;
...@@ -1704,6 +1708,10 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave ...@@ -1704,6 +1708,10 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
* Called with RTNL * Called with RTNL
*/ */
int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
__releases(&bond->curr_slave_lock)
__releases(&bond->lock)
__acquires(&bond->lock)
__acquires(&bond->curr_slave_lock)
{ {
struct bonding *bond = netdev_priv(bond_dev); struct bonding *bond = netdev_priv(bond_dev);
struct sockaddr *sa = addr; struct sockaddr *sa = addr;
......
...@@ -1002,6 +1002,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct ...@@ -1002,6 +1002,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct
static void bond_do_fail_over_mac(struct bonding *bond, static void bond_do_fail_over_mac(struct bonding *bond,
struct slave *new_active, struct slave *new_active,
struct slave *old_active) struct slave *old_active)
__releases(&bond->curr_slave_lock)
__releases(&bond->lock)
__acquires(&bond->lock)
__acquires(&bond->curr_slave_lock)
{ {
u8 tmp_mac[ETH_ALEN]; u8 tmp_mac[ETH_ALEN];
struct sockaddr saddr; struct sockaddr saddr;
...@@ -3193,6 +3197,8 @@ out: ...@@ -3193,6 +3197,8 @@ out:
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(&dev_base_lock)
__acquires(&bond->lock)
{ {
struct bonding *bond = seq->private; struct bonding *bond = seq->private;
loff_t off = 0; loff_t off = 0;
...@@ -3232,6 +3238,8 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -3232,6 +3238,8 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
} }
static void bond_info_seq_stop(struct seq_file *seq, void *v) static void bond_info_seq_stop(struct seq_file *seq, void *v)
__releases(&bond->lock)
__releases(&dev_base_lock)
{ {
struct bonding *bond = seq->private; struct bonding *bond = seq->private;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment