aboutsummaryrefslogtreecommitdiff
path: root/kernel/time/tick-common.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-04-25 20:31:49 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-08 07:29:27 -0800
commit409d4ffaf0c8b29693243918217cec0044979395 (patch)
tree6d9f0a5026f0cbac46802e5f9caf22fd1dc5fd89 /kernel/time/tick-common.c
parente8d630331dfe32c63438a4558eeda6f79c712485 (diff)
clockevents: Add module refcount
commit ccf33d6880f39a35158fff66db13000ae4943fac upstream. We want to be able to remove clockevent modules as well. Add a refcount so we don't remove a module with an active clock event device. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Magnus Damm <magnus.damm@gmail.com> Link: http://lkml.kernel.org/r/20130425143436.307435149@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Kim Phillips <kim.phillips@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/time/tick-common.c')
-rw-r--r--kernel/time/tick-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index d8e328cf481..e93af50726e 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -18,6 +18,7 @@
#include <linux/percpu.h>
#include <linux/profile.h>
#include <linux/sched.h>
+#include <linux/module.h>
#include <asm/irq_regs.h>
@@ -261,6 +262,9 @@ void tick_check_new_device(struct clock_event_device *newdev)
goto out_bc;
}
+ if (!try_module_get(newdev->owner))
+ return;
+
/*
* Replace the eventually existing device by the new
* device. If the current device is the broadcast device, do