Commit 28e84ab3 authored by Robert T. Johnson's avatar Robert T. Johnson Committed by David S. Miller

atm: [he] limit queries to the device's register space

From: "Robert T. Johnson" <rtjohnso@eecs.berkeley.edu>
Signed-off-by: default avatarChas Williams <chas@cmf.nrl.navy.mil>
parent 7e903c2a
...@@ -2845,10 +2845,15 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg) ...@@ -2845,10 +2845,15 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg)
if (copy_from_user(&reg, arg, if (copy_from_user(&reg, arg,
sizeof(struct he_ioctl_reg))) sizeof(struct he_ioctl_reg)))
return -EFAULT; return -EFAULT;
spin_lock_irqsave(&he_dev->global_lock, flags); spin_lock_irqsave(&he_dev->global_lock, flags);
switch (reg.type) { switch (reg.type) {
case HE_REGTYPE_PCI: case HE_REGTYPE_PCI:
if (reg.addr < 0 || reg.addr >= HE_REGMAP_SIZE) {
err = -EINVAL;
break;
}
reg.val = he_readl(he_dev, reg.addr); reg.val = he_readl(he_dev, reg.addr);
break; break;
case HE_REGTYPE_RCM: case HE_REGTYPE_RCM:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment