summaryrefslogtreecommitdiffstats
path: root/drivers/base/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-11-20 01:22:33 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-11-20 01:22:33 +0100
commit0aba0ab8915bcad3ae7e05e18bc2c5c55570e328 (patch)
treea0b47b29720fd77da240d1b32cd9c61ebf574c9d /drivers/base/power
parent9832bf3a35f55b8650280a6a3236859e751a1294 (diff)
parent6f9b36cd2497660e254c67ed131f0b297ed8bf40 (diff)
downloadlinux-0aba0ab8915bcad3ae7e05e18bc2c5c55570e328.tar.bz2
Merge branch 'pm-sleep'
* pm-sleep: PM / wakeirq: check that wake IRQ is valid before accepting it
Diffstat (limited to 'drivers/base/power')
-rw-r--r--drivers/base/power/wakeirq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index eb6e67451dec..0d77cd6fd8d1 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -68,6 +68,9 @@ int dev_pm_set_wake_irq(struct device *dev, int irq)
struct wake_irq *wirq;
int err;
+ if (irq < 0)
+ return -EINVAL;
+
wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
if (!wirq)
return -ENOMEM;
@@ -167,6 +170,9 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
struct wake_irq *wirq;
int err;
+ if (irq < 0)
+ return -EINVAL;
+
wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
if (!wirq)
return -ENOMEM;