projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e8505b
)
[PATCH] hpet: fix division by zero in HPET_INFO
author
Clemens Ladisch
<
[email protected]
>
Sun, 30 Oct 2005 23:03:38 +0000
(15:03 -0800)
committer
Linus Torvalds
<
[email protected]
>
Mon, 31 Oct 2005 01:37:30 +0000
(17:37 -0800)
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 <
[email protected]
>
Cc: Bob Picco <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/char/hpet.c
patch
|
blob
|
history
diff --git
a/drivers/char/hpet.c
b/drivers/char/hpet.c
index c85d11de5febcf76153d468f1955aea68d2779d4..bc5ee99b9c23787594677fa0a5eac4364b732a0d 100644
(file)
--- 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;