]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
isdn: hisax: Handle return value of pnp_irq and pnp_port_start
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 16 Nov 2017 04:27:24 +0000 (09:57 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Nov 2017 13:31:16 +0000 (22:31 +0900)
pnp_irq() and pnp_port_start() can fail here and we must check
its return value.

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

index e4f7573ba9bf6777c5fcd8548e1fbdb298f3a499..7a7137d8664b21e4f2c974706c4267c203dff0a1 100644 (file)
@@ -940,6 +940,8 @@ static int fcpnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
        }
        adapter->io = pnp_port_start(pdev, 0);
        adapter->irq = pnp_irq(pdev, 0);
+       if (!adapter->io || adapter->irq == -1)
+               goto err_free;
 
        printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
               (char *) dev_id->driver_data, adapter->io, adapter->irq);