diff options
| author | Alessandro Zummo <[email protected]> | 2014-04-03 21:50:09 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2014-04-03 23:21:22 +0000 |
| commit | 131c9cc832162bfe45be1065fa88d1ec2c165a3d (patch) | |
| tree | 6a5ede933809e4d50c382af08178e8d6dbd41863 /drivers/rtc/interface.c | |
| parent | drivers/rtc/rtc-ds3232.c: enable ds3232 to work as wakeup source (diff) | |
| download | kernel-131c9cc832162bfe45be1065fa88d1ec2c165a3d.tar.gz kernel-131c9cc832162bfe45be1065fa88d1ec2c165a3d.zip | |
rtc: verify a critical argument to rtc_update_irq() before using it
This small addition to the core simplifies code in the drivers and makes
them more robust when handling shared IRQs.
Signed-off-by: Alessandro Zummo <[email protected]>
Cc: Alexander Shiyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/rtc/interface.c')
| -rw-r--r-- | drivers/rtc/interface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 544be722937c..c2eff6082363 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -584,6 +584,9 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer) void rtc_update_irq(struct rtc_device *rtc, unsigned long num, unsigned long events) { + if (unlikely(IS_ERR_OR_NULL(rtc))) + return; + pm_stay_awake(rtc->dev.parent); schedule_work(&rtc->irqwork); } |
