Commit 87d75b52 authored by Jiri Slaby's avatar Jiri Slaby Committed by David S. Miller

NET: cassini, fix lock imbalance

Stanse found that one error path in cas_open omits to unlock pm_mutex.
Fix that.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2b2072e9
...@@ -4342,11 +4342,11 @@ static int cas_open(struct net_device *dev) ...@@ -4342,11 +4342,11 @@ static int cas_open(struct net_device *dev)
cas_unlock_all_restore(cp, flags); cas_unlock_all_restore(cp, flags);
} }
err = -ENOMEM;
if (cas_tx_tiny_alloc(cp) < 0) if (cas_tx_tiny_alloc(cp) < 0)
return -ENOMEM; goto err_unlock;
/* alloc rx descriptors */ /* alloc rx descriptors */
err = -ENOMEM;
if (cas_alloc_rxds(cp) < 0) if (cas_alloc_rxds(cp) < 0)
goto err_tx_tiny; goto err_tx_tiny;
...@@ -4386,6 +4386,7 @@ static int cas_open(struct net_device *dev) ...@@ -4386,6 +4386,7 @@ static int cas_open(struct net_device *dev)
cas_free_rxds(cp); cas_free_rxds(cp);
err_tx_tiny: err_tx_tiny:
cas_tx_tiny_free(cp); cas_tx_tiny_free(cp);
err_unlock:
mutex_unlock(&cp->pm_mutex); mutex_unlock(&cp->pm_mutex);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment