From: Clemens Ladisch <clemens@ladisch.de>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, Bob Picco <bob.picco@hp.com>,
Clemens Ladisch <clemens@ladisch.de>
Subject: [PATCH 3/7] HPET: fix division by zero in HPET_INFO
Date: Tue, 04 Oct 2005 14:41:43 +0200 (MEST) [thread overview]
Message-ID: <20051004124143.23057.56237.schnuffi@turing> (raw)
In-Reply-To: <20051004124126.23057.75614.schnuffi@turing>
From: Clemens Ladisch <clemens@ladisch.de>
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>
Index: linux-2.6.13/drivers/char/hpet.c
===================================================================
--- linux-2.6.13.orig/drivers/char/hpet.c 2005-10-03 22:53:12.000000000 +0200
+++ linux-2.6.13/drivers/char/hpet.c 2005-10-03 22:53:15.000000000 +0200
@@ -494,8 +494,11 @@ hpet_ioctl_common(struct hpet_dev *devp,
{
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;
next prev parent reply other threads:[~2005-10-04 12:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-04 12:41 [PATCH 0/7] more HPET fixes and enhancements Clemens Ladisch
2005-10-04 12:41 ` [PATCH 1/7] HPET: Fix mmap() of /dev/hpet Clemens Ladisch
2005-10-04 12:41 ` [PATCH 2/7] HPET: fix HPET_INFO calls from kernel space Clemens Ladisch
2005-10-04 12:41 ` Clemens Ladisch [this message]
2005-10-04 12:41 ` [PATCH 4/7] HPET: fix uninitialized variable in hpet_register() Clemens Ladisch
2005-10-04 12:41 ` [PATCH 5/7] HPET: fix access to multiple HPET devices Clemens Ladisch
2005-10-04 12:41 ` [PATCH 6/7] HPET: remove superfluous indirections Clemens Ladisch
2005-10-04 12:42 ` [PATCH 7/7] HPET: simplify initialization message Clemens Ladisch
2005-10-10 14:17 ` [PATCH 0/7] more HPET fixes and enhancements Bob Picco
2005-10-15 2:30 ` Randy.Dunlap
2005-10-17 16:30 ` Clemens Ladisch
2005-10-18 9:19 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051004124143.23057.56237.schnuffi@turing \
--to=clemens@ladisch.de \
--cc=akpm@osdl.org \
--cc=bob.picco@hp.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox