projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35f0ce0
)
intel_pmic_gpio: fix off-by-one value range checking
author
Axel Lin
<axel.lin@gmail.com>
Fri, 8 Oct 2010 09:54:31 +0000
(17:54 +0800)
committer
Matthew Garrett
<mjg@redhat.com>
Thu, 21 Oct 2010 14:10:47 +0000
(10:10 -0400)
In pmic_irq_type(), we use gpio as array index for trigger,
thus the valid value range for gpio should be 0 .. NUM_GPIO - 1.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/intel_pmic_gpio.c
patch
|
blob
|
history
diff --git
a/drivers/platform/x86/intel_pmic_gpio.c
b/drivers/platform/x86/intel_pmic_gpio.c
index
c6e2a1d
..
f540ff9
100644
(file)
--- a/
drivers/platform/x86/intel_pmic_gpio.c
+++ b/
drivers/platform/x86/intel_pmic_gpio.c
@@
-197,7
+197,7
@@
static int pmic_irq_type(unsigned irq, unsigned type)
u32 gpio = irq - pg->irq_base;
unsigned long flags;
- if (gpio > pg->chip.ngpio)
+ if (gpio >
=
pg->chip.ngpio)
return -EINVAL;
spin_lock_irqsave(&pg->irqtypes.lock, flags);