drivers/net/wireless/ipw2100.c: Release mutex in error handling code
The mutex is released on a successful return, so it would seem that it should be released on an error return as well. The semantic patch finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression l; @@ mutex_lock(l); ... when != mutex_unlock(l) when any when strict ( if (...) { ... when != mutex_unlock(l) + mutex_unlock(l); return ...; } | mutex_unlock(l); ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
e7087a828f
commit
80c42affad
1 changed files with 2 additions and 1 deletions
|
@ -6442,6 +6442,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
|
|||
if (err) {
|
||||
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
|
||||
dev->name);
|
||||
mutex_unlock(&priv->action_mutex);
|
||||
return err;
|
||||
}
|
||||
pci_restore_state(pci_dev);
|
||||
|
@ -7146,7 +7147,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
|
|||
err = ipw2100_get_ordinal(priv, IPW_ORD_CURRENT_TX_RATE, &val, &len);
|
||||
if (err) {
|
||||
IPW_DEBUG_WX("failed querying ordinals.\n");
|
||||
return err;
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch (val & TX_RATE_MASK) {
|
||||
|
|
Reference in a new issue