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: <20151108063627.GA29095@alpha.sfu-kras.ru>
Date:	Sun, 8 Nov 2015 13:36:27 +0700
From:	Ivan Safonov <insafonov@...il.com>
To:	devel@...verdev.osuosl.org
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Vaishali Thakkar <vthakkar1994@...il.com>,
	Jakub Sitnicki <jsitnicki@...il.com>,
	Anish Bhatt <anish@...ech.edu>, Joe Perches <joe@...ches.com>,
	Ivan Safonov <insafonov@...il.com>,
	Nicholas Mc Guire <der.herr@...r.at>,
	Alexey Khoroshilov <khoroshilov@...ras.ru>,
	Rémy Oudompheng <remyoudompheng@...il.com>,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Shraddha Barke <shraddha.6596@...il.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 01/12] staging: rtl8188eu: if/else replaced by min_t

Duplicated code removed.

Signed-off-by: Ivan Safonov <insafonov@...il.com>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 433b926..69f8744d9 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -442,10 +442,8 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
 
 	psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->IELength;
 
-	if ((psecnetwork->IELength-12) < (256-1))
-		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
-	else
-		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
+	memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12],
+	       min_t(size_t, psecnetwork->IELength - 12, 256 - 1));
 
 	psecnetwork->IELength = 0;
 	/*  Added by Albert 2009/02/18 */
-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ