summaryrefslogtreecommitdiff
path: root/drivers/pcmcia/soc_common.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-08-31 13:17:50 +0300
committerRussell King <rmk+kernel@armlinux.org.uk>2016-09-22 11:38:57 +0300
commita4941191235e0fee2dd8bad3b7c61478f229c962 (patch)
treedceac7aae8fb83d0771134a1dbf6837976bdacb3 /drivers/pcmcia/soc_common.c
parent45ca7536d4f9e803c27be113b17c4cdaa12cc960 (diff)
downloadlinux-a4941191235e0fee2dd8bad3b7c61478f229c962.tar.xz
pcmcia: soc_common: ignore invalid interrupts
If gpiod_to_irq() returns an invalid interrupt, we should not try to use it as an interrupt number. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/pcmcia/soc_common.c')
-rw-r--r--drivers/pcmcia/soc_common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index e07d84a69fcc..e499c2b8d7df 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -179,10 +179,12 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
if (skt->stat[i].desc) {
int irq = gpiod_to_irq(skt->stat[i].desc);
- if (i == SOC_STAT_RDY)
- skt->socket.pci_irq = irq;
- else
- skt->stat[i].irq = irq;
+ if (irq > 0) {
+ if (i == SOC_STAT_RDY)
+ skt->socket.pci_irq = irq;
+ else
+ skt->stat[i].irq = irq;
+ }
}
if (skt->stat[i].irq) {