lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1475253488-16674-1-git-send-email-weiyj.lk@gmail.com>
Date:   Sat,  1 Oct 2016 00:38:08 +0800
From:   Wei Yongjun <weiyj.lk@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Ivan Safonov <insafonov@...il.com>,
        Bhaktipriya Shridhar <bhaktipriya96@...il.com>,
        Luca Ceresoli <luca@...aceresoli.net>,
        Rémy Oudompheng <remyoudompheng@...il.com>,
        Kyle Kuffermann <kyle.kuffermann@...il.com>,
        Bhumika Goyal <bhumirks@...il.com>,
        Binoy Jayan <binoy.jayan@...aro.org>,
        Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Wei Yongjun <weiyj.lk@...il.com>, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] staging: rtl8188eu: fix double unlock error in rtw_resume_process()

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>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ