summaryrefslogtreecommitdiffstats
path: root/drivers/base
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
parentMerge branches 'pm-cpufreq' and 'acpi-cppc' (diff)
parentPM / wakeirq: check that wake IRQ is valid before accepting it (diff)
downloadlinux-0aba0ab8915bcad3ae7e05e18bc2c5c55570e328.tar.xz
linux-0aba0ab8915bcad3ae7e05e18bc2c5c55570e328.zip
Merge branch 'pm-sleep'
* pm-sleep: PM / wakeirq: check that wake IRQ is valid before accepting it
Diffstat (limited to 'drivers/base')
-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;