summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/orinoco.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2006-07-14 19:41:47 +0400
committerJohn W. Linville <linville@tuxdriver.com>2006-07-27 22:37:31 +0400
commitfe397d469fa3fbc678383ffbd0630e4849cca688 (patch)
tree4a4a65597912fefa8ff50d56ee5c7dc78d9b0e32 /drivers/net/wireless/orinoco.c
parent345f6b8beb20338a2d792bf5974d01d457abee53 (diff)
downloadlinux-fe397d469fa3fbc678383ffbd0630e4849cca688.tar.xz
[PATCH] orinoco: fix setting transmit key only
When determining whether there's a key to set or not, orinoco should be looking at the key length, not the key data. Otherwise confusion reigns when trying to set TX key only, passing in zero-length key, but non-NULL pointer. Key length takes precedence over non-NULL key data. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r--drivers/net/wireless/orinoco.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index d6ed5781b93a..317ace7f9aae 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -2875,7 +2875,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
- if (erq->pointer) {
+ if (erq->length > 0) {
if ((index < 0) || (index >= ORINOCO_MAX_KEYS))
index = priv->tx_key;
@@ -2918,7 +2918,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
if (erq->flags & IW_ENCODE_RESTRICTED)
restricted = 1;
- if (erq->pointer) {
+ if (erq->pointer && erq->length > 0) {
priv->keys[index].len = cpu_to_le16(xlen);
memset(priv->keys[index].data, 0,
sizeof(priv->keys[index].data));