diff options
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r-- | drivers/net/wireless/orinoco.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index d6ed5781b93a..1174ff53e025 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -82,6 +82,7 @@ | |||
82 | #include <linux/netdevice.h> | 82 | #include <linux/netdevice.h> |
83 | #include <linux/etherdevice.h> | 83 | #include <linux/etherdevice.h> |
84 | #include <linux/ethtool.h> | 84 | #include <linux/ethtool.h> |
85 | #include <linux/if_arp.h> | ||
85 | #include <linux/wireless.h> | 86 | #include <linux/wireless.h> |
86 | #include <net/iw_handler.h> | 87 | #include <net/iw_handler.h> |
87 | #include <net/ieee80211.h> | 88 | #include <net/ieee80211.h> |
@@ -2875,7 +2876,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev, | |||
2875 | if (orinoco_lock(priv, &flags) != 0) | 2876 | if (orinoco_lock(priv, &flags) != 0) |
2876 | return -EBUSY; | 2877 | return -EBUSY; |
2877 | 2878 | ||
2878 | if (erq->pointer) { | 2879 | if (erq->length > 0) { |
2879 | if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) | 2880 | if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) |
2880 | index = priv->tx_key; | 2881 | index = priv->tx_key; |
2881 | 2882 | ||
@@ -2918,7 +2919,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev, | |||
2918 | if (erq->flags & IW_ENCODE_RESTRICTED) | 2919 | if (erq->flags & IW_ENCODE_RESTRICTED) |
2919 | restricted = 1; | 2920 | restricted = 1; |
2920 | 2921 | ||
2921 | if (erq->pointer) { | 2922 | if (erq->pointer && erq->length > 0) { |
2922 | priv->keys[index].len = cpu_to_le16(xlen); | 2923 | priv->keys[index].len = cpu_to_le16(xlen); |
2923 | memset(priv->keys[index].data, 0, | 2924 | memset(priv->keys[index].data, 0, |
2924 | sizeof(priv->keys[index].data)); | 2925 | sizeof(priv->keys[index].data)); |