mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: davem@davemloft.net
Cc: linux-kernel@vger.kernel.org, jirislaby@gmail.com,
	netdev@vger.kernel.org, Debashis Dutt <ddutt@brocade.com>,
	Rasesh Mody <rmody@brocade.com>
Subject: [PATCH 1/1] NET: bna, fix lock imbalance
Date: Sat,  4 Sep 2010 14:08:41 +0200	[thread overview]
Message-ID: <1283602121-11443-1-git-send-email-jslaby@suse.cz> (raw)

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



             reply	other threads:[~2010-09-04 12:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-04 12:08 Jiri Slaby [this message]
2010-09-07  1:29 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283602121-11443-1-git-send-email-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=davem@davemloft.net \
    --cc=ddutt@brocade.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rmody@brocade.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®