diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-11-20 01:22:33 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-11-20 01:22:33 +0100 |
commit | 0aba0ab8915bcad3ae7e05e18bc2c5c55570e328 (patch) | |
tree | a0b47b29720fd77da240d1b32cd9c61ebf574c9d | |
parent | 9832bf3a35f55b8650280a6a3236859e751a1294 (diff) | |
parent | 6f9b36cd2497660e254c67ed131f0b297ed8bf40 (diff) | |
download | linux-0aba0ab8915bcad3ae7e05e18bc2c5c55570e328.tar.bz2 |
Merge branch 'pm-sleep'
* pm-sleep:
PM / wakeirq: check that wake IRQ is valid before accepting it
-rw-r--r-- | drivers/base/power/wakeirq.c | 6 |
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; |