diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-10-30 15:03:38 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 17:37:30 -0800 |
commit | af95eade68da4dfa29c5b64d79cffc9709facf00 (patch) | |
tree | 17db9f696dbdbb222d9a4a41e8d02f5378fe8d48 /drivers | |
parent | 8e8505be9c0ba608cbd634faa8fba361f17d2512 (diff) | |
download | kernel-crypto-af95eade68da4dfa29c5b64d79cffc9709facf00.tar.gz kernel-crypto-af95eade68da4dfa29c5b64d79cffc9709facf00.tar.xz kernel-crypto-af95eade68da4dfa29c5b64d79cffc9709facf00.zip |
[PATCH] hpet: fix division by zero in HPET_INFO
Fix a division by zero that happened when the HPET_INFO ioctl was called
before a timer frequency had been set.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: Bob Picco <bob.picco@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hpet.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index c85d11de5fe..bc5ee99b9c2 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -494,8 +494,11 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) { struct hpet_info info; - info.hi_ireqfreq = hpet_time_div(hpetp, - devp->hd_ireqfreq); + if (devp->hd_ireqfreq) + info.hi_ireqfreq = + hpet_time_div(hpetp, devp->hd_ireqfreq); + else + info.hi_ireqfreq = 0; info.hi_flags = readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK; info.hi_hpet = devp->hd_hpets->hp_which; |