diff options
-rw-r--r-- | drivers/char/hpet.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index c055bb630ffc..b619ca5eaf8c 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -364,6 +364,9 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp) | |||
364 | hpet = devp->hd_hpet; | 364 | hpet = devp->hd_hpet; |
365 | hpetp = devp->hd_hpets; | 365 | hpetp = devp->hd_hpets; |
366 | 366 | ||
367 | if (!devp->hd_ireqfreq) | ||
368 | return -EIO; | ||
369 | |||
367 | v = readq(&timer->hpet_config); | 370 | v = readq(&timer->hpet_config); |
368 | spin_lock_irq(&hpet_lock); | 371 | spin_lock_irq(&hpet_lock); |
369 | 372 | ||
@@ -516,7 +519,7 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) | |||
516 | break; | 519 | break; |
517 | } | 520 | } |
518 | 521 | ||
519 | if (arg & (arg - 1)) { | 522 | if (!arg || (arg & (arg - 1))) { |
520 | err = -EINVAL; | 523 | err = -EINVAL; |
521 | break; | 524 | break; |
522 | } | 525 | } |