aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/orinoco.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco/orinoco.c')
-rw-r--r--drivers/net/wireless/orinoco/orinoco.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco.c b/drivers/net/wireless/orinoco/orinoco.c
index c3bb85e0251e..45a04faa7818 100644
--- a/drivers/net/wireless/orinoco/orinoco.c
+++ b/drivers/net/wireless/orinoco/orinoco.c
@@ -1673,7 +1673,7 @@ static void print_linkstatus(struct net_device *dev, u16 status)
1673 s = "UNKNOWN"; 1673 s = "UNKNOWN";
1674 } 1674 }
1675 1675
1676 printk(KERN_INFO "%s: New link status: %s (%04x)\n", 1676 printk(KERN_DEBUG "%s: New link status: %s (%04x)\n",
1677 dev->name, s, status); 1677 dev->name, s, status);
1678} 1678}
1679 1679
@@ -5068,33 +5068,30 @@ static int orinoco_ioctl_set_genie(struct net_device *dev,
5068 struct orinoco_private *priv = netdev_priv(dev); 5068 struct orinoco_private *priv = netdev_priv(dev);
5069 u8 *buf; 5069 u8 *buf;
5070 unsigned long flags; 5070 unsigned long flags;
5071 int err = 0;
5072 5071
5073 /* cut off at IEEE80211_MAX_DATA_LEN */ 5072 /* cut off at IEEE80211_MAX_DATA_LEN */
5074 if ((wrqu->data.length > IEEE80211_MAX_DATA_LEN) || 5073 if ((wrqu->data.length > IEEE80211_MAX_DATA_LEN) ||
5075 (wrqu->data.length && (extra == NULL))) 5074 (wrqu->data.length && (extra == NULL)))
5076 return -EINVAL; 5075 return -EINVAL;
5077 5076
5078 if (orinoco_lock(priv, &flags) != 0)
5079 return -EBUSY;
5080
5081 if (wrqu->data.length) { 5077 if (wrqu->data.length) {
5082 buf = kmalloc(wrqu->data.length, GFP_KERNEL); 5078 buf = kmalloc(wrqu->data.length, GFP_KERNEL);
5083 if (buf == NULL) { 5079 if (buf == NULL)
5084 err = -ENOMEM; 5080 return -ENOMEM;
5085 goto out;
5086 }
5087 5081
5088 memcpy(buf, extra, wrqu->data.length); 5082 memcpy(buf, extra, wrqu->data.length);
5089 kfree(priv->wpa_ie); 5083 } else
5090 priv->wpa_ie = buf; 5084 buf = NULL;
5091 priv->wpa_ie_len = wrqu->data.length; 5085
5092 } else { 5086 if (orinoco_lock(priv, &flags) != 0) {
5093 kfree(priv->wpa_ie); 5087 kfree(buf);
5094 priv->wpa_ie = NULL; 5088 return -EBUSY;
5095 priv->wpa_ie_len = 0;
5096 } 5089 }
5097 5090
5091 kfree(priv->wpa_ie);
5092 priv->wpa_ie = buf;
5093 priv->wpa_ie_len = wrqu->data.length;
5094
5098 if (priv->wpa_ie) { 5095 if (priv->wpa_ie) {
5099 /* Looks like wl_lkm wants to check the auth alg, and 5096 /* Looks like wl_lkm wants to check the auth alg, and
5100 * somehow pass it to the firmware. 5097 * somehow pass it to the firmware.
@@ -5103,9 +5100,8 @@ static int orinoco_ioctl_set_genie(struct net_device *dev,
5103 */ 5100 */
5104 } 5101 }
5105 5102
5106out:
5107 orinoco_unlock(priv, &flags); 5103 orinoco_unlock(priv, &flags);
5108 return err; 5104 return 0;
5109} 5105}
5110 5106
5111static int orinoco_ioctl_get_genie(struct net_device *dev, 5107static int orinoco_ioctl_get_genie(struct net_device *dev,