[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>

authored by Dan Williams and committed by John W. Linville fe397d46 345f6b8b

+2 -2
+2 -2
drivers/net/wireless/orinoco.c
··· 2875 if (orinoco_lock(priv, &flags) != 0) 2876 return -EBUSY; 2877 2878 - if (erq->pointer) { 2879 if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) 2880 index = priv->tx_key; 2881 ··· 2918 if (erq->flags & IW_ENCODE_RESTRICTED) 2919 restricted = 1; 2920 2921 - if (erq->pointer) { 2922 priv->keys[index].len = cpu_to_le16(xlen); 2923 memset(priv->keys[index].data, 0, 2924 sizeof(priv->keys[index].data));
··· 2875 if (orinoco_lock(priv, &flags) != 0) 2876 return -EBUSY; 2877 2878 + if (erq->length > 0) { 2879 if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) 2880 index = priv->tx_key; 2881 ··· 2918 if (erq->flags & IW_ENCODE_RESTRICTED) 2919 restricted = 1; 2920 2921 + if (erq->pointer && erq->length > 0) { 2922 priv->keys[index].len = cpu_to_le16(xlen); 2923 memset(priv->keys[index].data, 0, 2924 sizeof(priv->keys[index].data));