Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40159
b: refs/heads/master
c: 7e4e8d9
h: refs/heads/master
i:
  40157: dfde4ba
  40155: 907be07
  40151: 65871b2
  40143: ae9e5e1
  40127: d737a25
v: v3
  • Loading branch information
Jean Tourrilhes authored and John W. Linville committed Oct 17, 2006
1 parent b86f46d commit 8b2ea71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 431aca5a18f15f61cc51c466073928c4f9565fe4
refs/heads/master: 7e4e8d99c2288a490a0806b9cb40016913312cfe
16 changes: 9 additions & 7 deletions trunk/drivers/net/wireless/orinoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,7 @@ void free_orinocodev(struct net_device *dev)
/* Wireless extensions */
/********************************************************************/

/* Return : < 0 -> error code ; >= 0 -> length */
static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
char buf[IW_ESSID_MAX_SIZE+1])
{
Expand Down Expand Up @@ -2501,9 +2502,9 @@ static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
len = le16_to_cpu(essidbuf.len);
BUG_ON(len > IW_ESSID_MAX_SIZE);

memset(buf, 0, IW_ESSID_MAX_SIZE+1);
memset(buf, 0, IW_ESSID_MAX_SIZE);
memcpy(buf, p, len);
buf[len] = '\0';
err = len;

fail_unlock:
orinoco_unlock(priv, &flags);
Expand Down Expand Up @@ -3027,17 +3028,18 @@ static int orinoco_ioctl_getessid(struct net_device *dev,

if (netif_running(dev)) {
err = orinoco_hw_get_essid(priv, &active, essidbuf);
if (err)
if (err < 0)
return err;
erq->length = err;
} else {
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
memcpy(essidbuf, priv->desired_essid, IW_ESSID_MAX_SIZE + 1);
memcpy(essidbuf, priv->desired_essid, IW_ESSID_MAX_SIZE);
erq->length = strlen(priv->desired_essid);
orinoco_unlock(priv, &flags);
}

erq->flags = 1;
erq->length = strlen(essidbuf);

return 0;
}
Expand Down Expand Up @@ -3075,10 +3077,10 @@ static int orinoco_ioctl_getnick(struct net_device *dev,
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;

memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE+1);
memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE);
orinoco_unlock(priv, &flags);

nrq->length = strlen(nickbuf);
nrq->length = strlen(priv->nick);

return 0;
}
Expand Down

0 comments on commit 8b2ea71

Please sign in to comment.