NET: bna, fix lock imbalance
authorJiri Slaby <jslaby@suse.cz>
Sat, 4 Sep 2010 02:08:41 +0000 (02:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Sep 2010 01:29:18 +0000 (18:29 -0700)
bnad_set_rx_mode omit to unlock bna_lock on one fail path. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Debashis Dutt <ddutt@brocade.com>
Cc: Rasesh Mody <rmody@brocade.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bna/bnad.c

index 44adc7aefddc13e2325e7f3a2fbb1cba367a0de9..8158fb93cb4c595351d007a7f2196b2659a40985 100644 (file)
@@ -2702,7 +2702,7 @@ bnad_set_rx_mode(struct net_device *netdev)
                        kzalloc((mc_count + 1) * ETH_ALEN,
                                GFP_ATOMIC);
                if (!mcaddr_list)
-                       return;
+                       goto unlock;
 
                memcpy(&mcaddr_list[0], &bnad_bcast_addr[0], ETH_ALEN);
 
@@ -2715,6 +2715,7 @@ bnad_set_rx_mode(struct net_device *netdev)
                /* Should we enable BNAD_CF_ALLMULTI for err != 0 ? */
                kfree(mcaddr_list);
        }
+unlock:
        spin_unlock_irqrestore(&bnad->bna_lock, flags);
 }