summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-08-26 01:00:30 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 21:03:40 (GMT)
commit8cfbc9dcde38c167b10c9c1b74f410f9a577b857 (patch)
tree5a2e43e7fe88548e490be8502e6b1c667b818ecf /drivers/staging/rtl8192u
parent0c43e56c3001fa4c55b01abf0d8a12bbc79aa148 (diff)
downloadlinux-fsl-qoriq-8cfbc9dcde38c167b10c9c1b74f410f9a577b857.tar.xz
Staging: rtl8192u: use is_broadcast_ether_addr() instead of memcmp()
Using is_broadcast_ether_addr() instead of directly use memcmp() to determine if the ethernet address is broadcast address. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index a6adfc9..6721ed9 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -20,6 +20,8 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
+#include <linux/etherdevice.h>
+
#include "dot11d.h"
u8 rsn_authen_cipher_suite[16][4] = {
@@ -2969,9 +2971,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
param->u.crypt.key_len);
return -EINVAL;
}
- if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
- param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
- param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+ if (is_broadcast_ether_addr(param->sta_addr)) {
if (param->u.crypt.idx >= WEP_KEYS)
return -EINVAL;
crypt = &ieee->crypt[param->u.crypt.idx];