]> git.baikalelectronics.ru Git - kernel.git/commit
RTC: Prevents a division by zero in kernel code.
authorMarcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br>
Wed, 2 Feb 2011 18:04:02 +0000 (16:04 -0200)
committerJohn Stultz <john.stultz@linaro.org>
Thu, 3 Feb 2011 20:59:50 +0000 (12:59 -0800)
commit23104511663e80098a9625c0ece39b4de3ee4199
treeebb70cdc221d06529fd327e284f1b9191939f6aa
parentfcf417ff5f9b9f612c5ba1f3b298889ea4f0642f
RTC: Prevents a division by zero in kernel code.

This patch prevents a user space program from calling the RTC_IRQP_SET
ioctl with a negative value of frequency. Also, if this call is make
with a zero value of frequency, there would be a division by zero in the
kernel code.

[jstultz: Also initialize irq_freq to 1 to catch other divbyzero issues]

CC: Alessandro Zummo <a.zummo@towertech.it>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br>
Signed-off-by: John Stultz <john.stultz@linaro.org>
drivers/rtc/class.c
drivers/rtc/interface.c