lkml.org 
[lkml]   [2010]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] NET: bna, fix lock imbalance
Date
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>
---
drivers/net/bna/bnad.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index cbc1d56..a1a449a 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -2706,7 +2706,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);

@@ -2719,6 +2719,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);
}

--
1.7.2.2



\
 
 \ /
  Last update: 2010-09-04 14:11    [W:0.028 / U:5.488 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site