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>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 24 Mar 2021 16:50:36 +0100
From:   Fabio Aiuto <fabioaiuto83@...il.com>
To:     gregkh@...uxfoundation.org
Cc:     linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Fabio Aiuto <fabioaiuto83@...il.com>
Subject: [PATCH 3/3] staging: rtl8723bs: remove assignment in condition in os_dep/ioctl_linux.c

fix the following checkpatch warning:

ERROR: do not use assignment in if condition
2607: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2607:
+	if (0 != (ret = rtw_change_ifname(padapter, new_ifname)))
--
ERROR: do not use assignment in if condition
4239: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:4239:
+	if (!(ext = vmalloc(len)))
--
ERROR: do not use assignment in if condition
4253: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:4253:
+	if (!(ext_dbg = vmalloc(len))) {

Signed-off-by: Fabio Aiuto <fabioaiuto83@...il.com>
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 9909dece0b01..eac98e455413 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -2604,7 +2604,8 @@ static int rtw_rereg_nd_name(struct net_device *dev,
 		return ret;
 
 	DBG_871X("%s new_ifname:%s\n", __func__, new_ifname);
-	if (0 != (ret = rtw_change_ifname(padapter, new_ifname)))
+	ret = rtw_change_ifname(padapter, new_ifname);
+	if (ret != 0)
 		goto exit;
 
 	strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ);
@@ -4236,7 +4237,8 @@ static int rtw_wx_set_priv(struct net_device *dev,
 		return -EFAULT;
 
 	len = dwrq->length;
-	if (!(ext = vmalloc(len)))
+	ext = vmalloc(len);
+	if (!ext)
 		return -ENOMEM;
 
 	if (copy_from_user(ext, dwrq->pointer, len)) {
@@ -4250,7 +4252,8 @@ static int rtw_wx_set_priv(struct net_device *dev,
 	/* 	  dev->name, ext)); */
 
 	#ifdef DEBUG_RTW_WX_SET_PRIV
-	if (!(ext_dbg = vmalloc(len))) {
+	ext_dbg = vmalloc(len);
+	if (!ext_dbg) {
 		vfree(ext, len);
 		return -ENOMEM;
 	}
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ