[PATCH 03/12] pcmcia: soc_common: ignore invalid interrupts

Russell King rmk+kernel at armlinux.org.uk
Wed Sep 28 10:10:21 PDT 2016


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 at armlinux.org.uk>
---
 drivers/pcmcia/soc_common.c | 10 ++++++----
 1 file 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) {
-- 
2.1.0




More information about the linux-pcmcia mailing list