orinoco: fix setting transmit key only
Subsystems (3)
PATCH 1/1 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 <[email protected]>
drivers/net/wireless/orinoco.c +2 -2
@@ -2876,7 +2876,7 @@ static int orinoco_ioctl_setiwencode(strif (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;
@@ -2919,7 +2919,7 @@ static int orinoco_ioctl_setiwencode(strif (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));