aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2014-03-07 12:54:30 -0800
committerZiyan <jaraidaniel@gmail.com>2016-03-11 15:56:52 +0100
commit64c760879d1bfd265c68fe6c9e13a2cf96131837 (patch)
tree00a827b06faa4f0e96777807c418f5c7047215b6 /kernel
parentd6cf5c411d010443e8e9d764c0831bac4f082561 (diff)
downloadkernel_samsung_espresso10-64c760879d1bfd265c68fe6c9e13a2cf96131837.zip
kernel_samsung_espresso10-64c760879d1bfd265c68fe6c9e13a2cf96131837.tar.gz
kernel_samsung_espresso10-64c760879d1bfd265c68fe6c9e13a2cf96131837.tar.bz2
Power: Add guard condition for maximum wakeup reasons
Ensure the array for the wakeup reason IRQs does not overflow. Change-Id: Iddc57a3aeb1888f39d4e7b004164611803a4d37c Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/wakeup_reason.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/power/wakeup_reason.c b/kernel/power/wakeup_reason.c
index 9823d9c..1e12773 100644
--- a/kernel/power/wakeup_reason.c
+++ b/kernel/power/wakeup_reason.c
@@ -78,6 +78,13 @@ void log_wakeup_reason(int irq)
printk(KERN_INFO "Resume caused by IRQ %d\n", irq);
spin_lock(&resume_reason_lock);
+ if (irq_count == MAX_WAKEUP_REASON_IRQS) {
+ spin_unlock(&resume_reason_lock);
+ printk(KERN_WARNING "Resume caused by more than %d IRQs\n",
+ MAX_WAKEUP_REASON_IRQS);
+ return;
+ }
+
irq_list[irq_count++] = irq;
spin_unlock(&resume_reason_lock);
}