]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
isdn: hisax: Fix pnp_irq's error checking for setup_isurf
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 16 Nov 2017 04:27:25 +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/isurf.c

index 1399ddd4f6cb3b62bdae723b63e0ffe86461a615..53e299be430403c5ac71781fe1b785cdc4507ad5 100644 (file)
@@ -238,7 +238,7 @@ int setup_isurf(struct IsdnCard *card)
                                cs->hw.isurf.reset = pnp_port_start(pnp_d, 0);
                                cs->hw.isurf.phymem = pnp_mem_start(pnp_d, 1);
                                cs->irq = pnp_irq(pnp_d, 0);
-                               if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
+                               if (cs->irq == -1 || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
                                        printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
                                               cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
                                        pnp_disable_dev(pnp_d);