Patchwork [1/1] NET: cassini, fix lock imbalance

login
register
mail settings
Submitter Jiri Slaby
Date Nov. 6, 2009, 9:14 a.m.
Message ID <1257498869-4374-1-git-send-email-jirislaby@gmail.com>
Download mbox | patch
Permalink /patch/37832/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jiri Slaby - Nov. 6, 2009, 9:14 a.m.
Stanse found that one error path in cas_open omits to unlock pm_mutex.
Fix that.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/net/cassini.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
David Miller - Nov. 7, 2009, 4:26 a.m.
From: Jiri Slaby <jirislaby@gmail.com>
Date: Fri,  6 Nov 2009 10:14:29 +0100

> Stanse found that one error path in cas_open omits to unlock pm_mutex.
> Fix that.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

Applied to net-2.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 05916aa..f857afe 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4342,11 +4342,11 @@  static int cas_open(struct net_device *dev)
 		cas_unlock_all_restore(cp, flags);
 	}
 
+	err = -ENOMEM;
 	if (cas_tx_tiny_alloc(cp) < 0)
-		return -ENOMEM;
+		goto err_unlock;
 
 	/* alloc rx descriptors */
-	err = -ENOMEM;
 	if (cas_alloc_rxds(cp) < 0)
 		goto err_tx_tiny;
 
@@ -4386,6 +4386,7 @@  err_spare:
 	cas_free_rxds(cp);
 err_tx_tiny:
 	cas_tx_tiny_free(cp);
+err_unlock:
 	mutex_unlock(&cp->pm_mutex);
 	return err;
 }