Commit 148d7116 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

staging: rtl8187se: 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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8cfbc9dc
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/etherdevice.h>
#include "dot11d.h" #include "dot11d.h"
u8 rsn_authen_cipher_suite[16][4] = { u8 rsn_authen_cipher_suite[16][4] = {
...@@ -2808,9 +2809,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ...@@ -2808,9 +2809,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
param->u.crypt.key_len); param->u.crypt.key_len);
return -EINVAL; return -EINVAL;
} }
if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && if (is_broadcast_ether_addr(param->sta_addr)) {
param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
if (param->u.crypt.idx >= WEP_KEYS) if (param->u.crypt.idx >= WEP_KEYS)
return -EINVAL; return -EINVAL;
crypt = &ieee->crypt[param->u.crypt.idx]; crypt = &ieee->crypt[param->u.crypt.idx];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment