aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-11-05 23:14:29 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-06 20:26:09 -0800
commit87d75b52414a22c54cf8382bcdd329376b1bce78 (patch)
tree8e4c5833bf419f366db516a4df94f23ea3bbcde1 /drivers/net
parent2b2072e902848a63168570f500a5726744b3873a (diff)
NET: cassini, fix lock imbalance
Stanse found that one error path in cas_open omits to unlock pm_mutex. Fix that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/cassini.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 05916aafa4f..f857afe8e48 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;
}