提交 1611a52c 编写于 作者: J Julia Lawall 提交者: Greg Kroah-Hartman

Staging: wlan-ng: p80211wext.c: problem with IW_ENCODE_ALG_WEP

The expression !(ext->alg & IW_ENCODE_ALG_WEP) appears to be incorrect,
because there are several possible values for ext->alg that give 1 when
bit-anded with IW_ENCODE_ALG_WEP.  Therefore Richard Kennedy suggested to
rewrite the code with !=

Added \n at the end of the debug string as well.
Signed-off-by: NJulia Lawall <julia@diku.dk>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 f2b50b40
......@@ -1487,8 +1487,8 @@ static int p80211wext_set_encodeext(struct net_device *dev,
}
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
if (!(ext->alg & IW_ENCODE_ALG_WEP)) {
pr_debug("asked to set a non wep key :(");
if (ext->alg != IW_ENCODE_ALG_WEP) {
pr_debug("asked to set a non wep key :(\n");
return -EINVAL;
}
if (idx) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册