aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r--drivers/net/wireless/airo.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index c36d3a3d655f..d73475739127 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -6501,7 +6501,10 @@ static int airo_get_encode(struct net_device *dev,
6501 6501
6502 /* Copy the key to the user buffer */ 6502 /* Copy the key to the user buffer */
6503 dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); 6503 dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf));
6504 memcpy(extra, buf, dwrq->length); 6504 if (dwrq->length != -1)
6505 memcpy(extra, buf, dwrq->length);
6506 else
6507 dwrq->length = 0;
6505 6508
6506 return 0; 6509 return 0;
6507} 6510}
@@ -6659,7 +6662,10 @@ static int airo_get_encodeext(struct net_device *dev,
6659 6662
6660 /* Copy the key to the user buffer */ 6663 /* Copy the key to the user buffer */
6661 ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); 6664 ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf));
6662 memcpy(extra, buf, ext->key_len); 6665 if (ext->key_len != -1)
6666 memcpy(extra, buf, ext->key_len);
6667 else
6668 ext->key_len = 0;
6663 6669
6664 return 0; 6670 return 0;
6665} 6671}