Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130168
b: refs/heads/master
c: 7fe99c4
h: refs/heads/master
v: v3
  • Loading branch information
Andrey Borzenkov authored and John W. Linville committed Jan 22, 2009
1 parent 4119922 commit 8598432
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5dc306f3bd1d4cfdf79df39221b3036eab1ddcf3
refs/heads/master: 7fe99c4e28ab54eada8aa456b417114e6ef21587
30 changes: 13 additions & 17 deletions trunk/drivers/net/wireless/orinoco/orinoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -5068,33 +5068,30 @@ static int orinoco_ioctl_set_genie(struct net_device *dev,
struct orinoco_private *priv = netdev_priv(dev);
u8 *buf;
unsigned long flags;
int err = 0;

/* cut off at IEEE80211_MAX_DATA_LEN */
if ((wrqu->data.length > IEEE80211_MAX_DATA_LEN) ||
(wrqu->data.length && (extra == NULL)))
return -EINVAL;

if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;

if (wrqu->data.length) {
buf = kmalloc(wrqu->data.length, GFP_KERNEL);
if (buf == NULL) {
err = -ENOMEM;
goto out;
}
if (buf == NULL)
return -ENOMEM;

memcpy(buf, extra, wrqu->data.length);
kfree(priv->wpa_ie);
priv->wpa_ie = buf;
priv->wpa_ie_len = wrqu->data.length;
} else {
kfree(priv->wpa_ie);
priv->wpa_ie = NULL;
priv->wpa_ie_len = 0;
} else
buf = NULL;

if (orinoco_lock(priv, &flags) != 0) {
kfree(buf);
return -EBUSY;
}

kfree(priv->wpa_ie);
priv->wpa_ie = buf;
priv->wpa_ie_len = wrqu->data.length;

if (priv->wpa_ie) {
/* Looks like wl_lkm wants to check the auth alg, and
* somehow pass it to the firmware.
Expand All @@ -5103,9 +5100,8 @@ static int orinoco_ioctl_set_genie(struct net_device *dev,
*/
}

out:
orinoco_unlock(priv, &flags);
return err;
return 0;
}

static int orinoco_ioctl_get_genie(struct net_device *dev,
Expand Down

0 comments on commit 8598432

Please sign in to comment.