[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1487198500.648977053@decadent.org.uk>
Date: Wed, 15 Feb 2017 22:41:40 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Wei Yongjun" <weiyj.lk@...il.com>,
"Dan Carpenter" <dan.carpenter@...cle.com>
Subject: [PATCH 3.16 087/306] staging: rtl8188eu: fix double unlock error
in rtw_resume_process()
3.16.40-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <weiyj.lk@...il.com>
commit 23bf40424a0f641ca7ff4225add4aa592086bdd5 upstream.
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: eaf47b713b60 ("staging: rtl8188eu: fix missing unlock on error in rtw_resume_process()")
Reported-By: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Wei Yongjun <weiyj.lk@...il.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
[bwh: Backported to 3.16:
- Adjust context
- Unlock pwrctrl_priv::lock]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/staging/rtl8188eu/os_dep/usb_intf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -494,8 +494,10 @@ int rtw_resume_process(struct adapter *p
pwrpriv->bkeepfwalive = false;
DBG_88E("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive);
- if (pm_netdev_open(pnetdev, true) != 0)
+ if (pm_netdev_open(pnetdev, true) != 0) {
+ _exit_pwrlock(&pwrpriv->lock);
goto exit;
+ }
netif_device_attach(pnetdev);
netif_carrier_on(pnetdev);
@@ -511,10 +513,8 @@ int rtw_resume_process(struct adapter *p
ret = 0;
exit:
- if (pwrpriv) {
+ if (pwrpriv)
pwrpriv->bInSuspend = false;
- _exit_pwrlock(&pwrpriv->lock);
- }
DBG_88E("<=== %s return %d.............. in %dms\n", __func__,
ret, rtw_get_passing_time_ms(start_time));
Powered by blists - more mailing lists