Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79124
b: refs/heads/master
c: 99c893f
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent ca1829e commit a2af3e3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 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: c12bdc45d9bc4e576ca54944b708cd45c738ec07
refs/heads/master: 99c893f34ab932171af27264c0cba4946ca0c355
29 changes: 19 additions & 10 deletions trunk/drivers/net/wireless/libertas/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,23 @@ static ssize_t lbs_setuserscan(struct file *file,
struct lbs_ioctl_user_scan_cfg *scan_cfg;
union iwreq_data wrqu;
int dur;
unsigned long addr = get_zeroed_page(GFP_KERNEL);
char *buf = (char *)addr;
char *buf = (char *)get_zeroed_page(GFP_KERNEL);

scan_cfg = kzalloc(sizeof(struct lbs_ioctl_user_scan_cfg), GFP_KERNEL);
if (!scan_cfg)
if (!buf)
return -ENOMEM;

buf_size = min(count, len - 1);
if (copy_from_user(buf, userbuf, buf_size)) {
res = -EFAULT;
goto out_unlock;
goto out_buf;
}

scan_cfg = kzalloc(sizeof(struct lbs_ioctl_user_scan_cfg), GFP_KERNEL);
if (!scan_cfg) {
res = -ENOMEM;
goto out_buf;
}
res = count;

scan_cfg->bsstype = LBS_SCAN_BSS_TYPE_ANY;

Expand All @@ -317,15 +322,19 @@ static ssize_t lbs_setuserscan(struct file *file,

lbs_scan_networks(priv, scan_cfg, 1);
wait_event_interruptible(priv->adapter->cmd_pending,
!priv->adapter->nr_cmd_pending);
priv->adapter->surpriseremoved || !priv->adapter->nr_cmd_pending);

if (priv->adapter->surpriseremoved)
goto out_scan_cfg;

memset(&wrqu, 0x00, sizeof(union iwreq_data));
wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);

out_unlock:
free_page(addr);
out_scan_cfg:
kfree(scan_cfg);
return count;
out_buf:
free_page((unsigned long)buf);
return res;
}


Expand Down

0 comments on commit a2af3e3

Please sign in to comment.