From: Wei Yongjun <weiyj.lk@gmail.com>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Ivan Safonov" <insafonov@gmail.com>,
"Bhaktipriya Shridhar" <bhaktipriya96@gmail.com>,
"Luca Ceresoli" <luca@lucaceresoli.net>,
"Rémy Oudompheng" <remyoudompheng@gmail.com>,
"Kyle Kuffermann" <kyle.kuffermann@gmail.com>,
"Bhumika Goyal" <bhumirks@gmail.com>,
"Binoy Jayan" <binoy.jayan@linaro.org>,
"Dan Carpenter" <dan.carpenter@oracle.com>
Cc: Wei Yongjun <weiyj.lk@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: rtl8188eu: fix double unlock error in rtw_resume_process()
Date: Sat, 1 Oct 2016 00:38:08 +0800 [thread overview]
Message-ID: <1475253488-16674-1-git-send-email-weiyj.lk@gmail.com> (raw)
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@oracle.com>
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index b2bc09e..68e1e6b 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -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);
@@ -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));
--
2.7.4
reply other threads:[~2016-09-30 16:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475253488-16674-1-git-send-email-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=bhaktipriya96@gmail.com \
--cc=bhumirks@gmail.com \
--cc=binoy.jayan@linaro.org \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=insafonov@gmail.com \
--cc=kyle.kuffermann@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca@lucaceresoli.net \
--cc=remyoudompheng@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®