isdn: hisax: Fix pnp_irq's error checking for setup_teles3
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 16 Nov 2017 04:27:29 +0000 (09:57 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Nov 2017 13:31:16 +0000 (22:31 +0900)
The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/hisax/teles3.c

index 38fb2c1a3f0f48cdbbf3511a467d09e16b042e33..1eef693f04f038c3032efdb6d49a204a2ff6721a 100644 (file)
@@ -306,7 +306,7 @@ int setup_teles3(struct IsdnCard *card)
                                        card->para[2] = pnp_port_start(pnp_d, 1);
                                        card->para[1] = pnp_port_start(pnp_d, 0);
                                        card->para[0] = pnp_irq(pnp_d, 0);
-                                       if (!card->para[0] || !card->para[1] || !card->para[2]) {
+                                       if (card->para[0] == -1 || !card->para[1] || !card->para[2]) {
                                                printk(KERN_ERR "Teles PnP:some resources are missing %ld/%lx/%lx\n",
                                                       card->para[0], card->para[1], card->para[2]);
                                                pnp_disable_dev(pnp_d);