diff options
-rw-r--r-- | drivers/atm/he.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 320320e3dfb3..fc636a3429cf 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
@@ -2845,10 +2845,15 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg) | |||
2845 | if (copy_from_user(®, arg, | 2845 | if (copy_from_user(®, arg, |
2846 | sizeof(struct he_ioctl_reg))) | 2846 | sizeof(struct he_ioctl_reg))) |
2847 | return -EFAULT; | 2847 | return -EFAULT; |
2848 | 2848 | ||
2849 | spin_lock_irqsave(&he_dev->global_lock, flags); | 2849 | spin_lock_irqsave(&he_dev->global_lock, flags); |
2850 | switch (reg.type) { | 2850 | switch (reg.type) { |
2851 | case HE_REGTYPE_PCI: | 2851 | case HE_REGTYPE_PCI: |
2852 | if (reg.addr < 0 || reg.addr >= HE_REGMAP_SIZE) { | ||
2853 | err = -EINVAL; | ||
2854 | break; | ||
2855 | } | ||
2856 | |||
2852 | reg.val = he_readl(he_dev, reg.addr); | 2857 | reg.val = he_readl(he_dev, reg.addr); |
2853 | break; | 2858 | break; |
2854 | case HE_REGTYPE_RCM: | 2859 | case HE_REGTYPE_RCM: |