Skip to content

Commit

Permalink
staging: rtl8188eu: fix double unlock error in rtw_resume_process()
Browse files Browse the repository at this point in the history
Fix following static checker warning:
    drivers/staging/rtl8188eu/os_dep/usb_intf.c:311 rtw_resume_process()
    error: double unlock 'mutex:&pwrpriv->mutex_lock'

Fixes: eaf47b7 ("staging: rtl8188eu: fix missing unlock on error in rtw_resume_process()")
Reported-By: Dan Carpenter <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
weiyj authored and gregkh committed Oct 2, 2016
1 parent 612e1c9 commit 23bf404
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/rtl8188eu/os_dep/usb_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ static int rtw_resume_process(struct adapter *padapter)
pwrpriv->bkeepfwalive = false;

pr_debug("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive);
if (pm_netdev_open(pnetdev, true) != 0)
if (pm_netdev_open(pnetdev, true) != 0) {
mutex_unlock(&pwrpriv->mutex_lock);
goto exit;
}

netif_device_attach(pnetdev);
netif_carrier_on(pnetdev);
Expand All @@ -306,10 +308,8 @@ static int rtw_resume_process(struct adapter *padapter)

ret = 0;
exit:
if (pwrpriv) {
if (pwrpriv)
pwrpriv->bInSuspend = false;
mutex_unlock(&pwrpriv->mutex_lock);
}
pr_debug("<=== %s return %d.............. in %dms\n", __func__,
ret, jiffies_to_msecs(jiffies - start_time));

Expand Down

0 comments on commit 23bf404

Please sign in to comment.