From 40ba60ddfeff8ef42fb33c0bdacfbb5f83e96b32 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Thu, 20 Aug 2009 21:00:34 +0300 Subject: [PATCH] rndis_wlan: fix broken logic in add_wep_key() add_wep_key() tries to check if key length is not 5 AND not 13 but uses (key_len != 5 || key_len != 13) instead. Fix this. Signed-off-by: Jussi Kivilinna Signed-off-by: John W. Linville --- drivers/net/wireless/rndis_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index d42692dfbc67..c5b921bf5a96 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c @@ -1214,7 +1214,7 @@ static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index) struct ndis_80211_wep_key ndis_key; int cipher, ret; - if ((key_len != 5 || key_len != 13) || index < 0 || index > 3) + if ((key_len != 5 && key_len != 13) || index < 0 || index > 3) return -EINVAL; if (key_len == 5) -- 2.39.5