Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72866
b: refs/heads/master
c: e3376dc
h: refs/heads/master
v: v3
  • Loading branch information
Roel Kluin authored and David S. Miller committed Oct 30, 2007
1 parent 047e9e7 commit c82ad67
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 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: 521c2a43b2e72dd5c9ab1b1ae7f894ba8a58779d
refs/heads/master: e3376dca81bd45474143753339e109d877a7d129
55 changes: 34 additions & 21 deletions trunk/drivers/net/wan/lmc/lmc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
* To date internally, just copy this out to the user.
*/
case LMCIOCGINFO: /*fold01*/
if (copy_to_user(ifr->ifr_data, &sc->ictl, sizeof (lmc_ctl_t)))
return -EFAULT;
ret = 0;
if (copy_to_user(ifr->ifr_data, &sc->ictl, sizeof(lmc_ctl_t)))
ret = -EFAULT;
else
ret = 0;
break;

case LMCIOCSINFO: /*fold01*/
Expand All @@ -159,8 +160,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
break;
}

if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)))
return -EFAULT;
if (copy_from_user(&ctl, ifr->ifr_data, sizeof(lmc_ctl_t))) {
ret = -EFAULT;
break;
}

sc->lmc_media->set_status (sc, &ctl);

Expand Down Expand Up @@ -190,8 +193,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
break;
}

if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t)))
return -EFAULT;
if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t))) {
ret = -EFAULT;
break;
}


if (new_type == old_type)
Expand Down Expand Up @@ -229,9 +234,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
sc->lmc_xinfo.Magic1 = 0xDEADBEEF;

if (copy_to_user(ifr->ifr_data, &sc->lmc_xinfo,
sizeof (struct lmc_xinfo)))
return -EFAULT;
ret = 0;
sizeof(struct lmc_xinfo))) {
ret = -EFAULT;
else
ret = 0;

break;

Expand Down Expand Up @@ -262,9 +268,9 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/

if (copy_to_user(ifr->ifr_data, &sc->stats,
sizeof (struct lmc_statistics)))
return -EFAULT;

ret = 0;
ret = -EFAULT;
else
ret = 0;
break;

case LMCIOCCLEARLMCSTATS: /*fold01*/
Expand Down Expand Up @@ -292,8 +298,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
break;
}

if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)))
return -EFAULT;
if (copy_from_user(&ctl, ifr->ifr_data, sizeof(lmc_ctl_t))) {
ret = -EFAULT;
break;
}
sc->lmc_media->set_circuit_type(sc, ctl.circuit_type);
sc->ictl.circuit_type = ctl.circuit_type;
ret = 0;
Expand All @@ -318,12 +326,15 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/

#ifdef DEBUG
case LMCIOCDUMPEVENTLOG:
if (copy_to_user(ifr->ifr_data, &lmcEventLogIndex, sizeof (u32)))
return -EFAULT;
if (copy_to_user(ifr->ifr_data, &lmcEventLogIndex, sizeof(u32))) {
ret = -EFAULT;
break;
}
if (copy_to_user(ifr->ifr_data + sizeof (u32), lmcEventLogBuf, sizeof (lmcEventLogBuf)))
return -EFAULT;
ret = -EFAULT;
else
ret = 0;

ret = 0;
break;
#endif /* end ifdef _DBG_EVENTLOG */
case LMCIOCT1CONTROL: /*fold01*/
Expand All @@ -346,8 +357,10 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
*/
netif_stop_queue(dev);

if (copy_from_user(&xc, ifr->ifr_data, sizeof (struct lmc_xilinx_control)))
return -EFAULT;
if (copy_from_user(&xc, ifr->ifr_data, sizeof(struct lmc_xilinx_control))) {
ret = -EFAULT;
break;
}
switch(xc.command){
case lmc_xilinx_reset: /*fold02*/
{
Expand Down

0 comments on commit c82ad67

Please sign in to comment.