Skip to content

Commit

Permalink
atm: [he] limit queries to the device's register space
Browse files Browse the repository at this point in the history
From: "Robert T. Johnson" <rtjohnso@eecs.berkeley.edu>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
  • Loading branch information
Robert T. Johnson authored and David S. Miller committed Jun 17, 2008
1 parent 7e903c2 commit 28e84ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/atm/he.c
Original file line number Diff line number Diff line change
Expand Up @@ -2845,10 +2845,15 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg)
if (copy_from_user(&reg, arg,
sizeof(struct he_ioctl_reg)))
return -EFAULT;

spin_lock_irqsave(&he_dev->global_lock, flags);
switch (reg.type) {
case HE_REGTYPE_PCI:
if (reg.addr < 0 || reg.addr >= HE_REGMAP_SIZE) {
err = -EINVAL;
break;
}

reg.val = he_readl(he_dev, reg.addr);
break;
case HE_REGTYPE_RCM:
Expand Down

0 comments on commit 28e84ab

Please sign in to comment.