Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291138
b: refs/heads/master
c: f096ce6
h: refs/heads/master
v: v3
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Mar 5, 2012
1 parent 5020deb commit 1623afe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f808e4ad05704d4ba0082fbb27640294c6fa4eae
refs/heads/master: f096ce6d244a380a78e19a7d7a25d9a4a6a6c9b7
8 changes: 5 additions & 3 deletions trunk/drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1387,13 +1387,15 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len,
netdev_dbg(usbdev->net, "%s(idx: %d, len: %d)\n",
__func__, index, key_len);

if ((key_len != 5 && key_len != 13) || index < 0 || index > 3)
if (index < 0 || index >= RNDIS_WLAN_NUM_KEYS)
return -EINVAL;

if (key_len == 5)
cipher = WLAN_CIPHER_SUITE_WEP40;
else
else if (key_len == 13)
cipher = WLAN_CIPHER_SUITE_WEP104;
else
return -EINVAL;

memset(&ndis_key, 0, sizeof(ndis_key));

Expand Down Expand Up @@ -1436,7 +1438,7 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
bool is_addr_ok;
int ret;

if (index < 0 || index >= 4) {
if (index < 0 || index >= RNDIS_WLAN_NUM_KEYS) {
netdev_dbg(usbdev->net, "%s(): index out of range (%i)\n",
__func__, index);
return -EINVAL;
Expand Down

0 comments on commit 1623afe

Please sign in to comment.