Skip to content

Commit

Permalink
NET: cassini, fix lock imbalance
Browse files Browse the repository at this point in the history
Stanse found that one error path in cas_open omits to unlock pm_mutex.
Fix that.

Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jirislaby authored and davem330 committed Nov 7, 2009
1 parent 2b2072e commit 87d75b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -4386,6 +4386,7 @@ static int cas_open(struct net_device *dev)
cas_free_rxds(cp);
err_tx_tiny:
cas_tx_tiny_free(cp);
err_unlock:
mutex_unlock(&cp->pm_mutex);
return err;
}
Expand Down

0 comments on commit 87d75b5

Please sign in to comment.