[PATCH 1/1] NET: bna, fix lock imbalance

From: Jiri Slaby
Date: Sat Sep 04 2010 - 08:09:06 EST


bnad_set_rx_mode omit to unlock bna_lock on one fail path. Fix that.

Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
Cc: Debashis Dutt <ddutt@xxxxxxxxxxx>
Cc: Rasesh Mody <rmody@xxxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
---
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/