Browse Source

[myson] Check for ioremap() failures

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
720ae17aa4
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/drivers/net/myson.c

+ 5
- 0
src/drivers/net/myson.c View File

@@ -603,6 +603,10 @@ static int myson_probe ( struct pci_device *pci ) {
603 603
 
604 604
 	/* Map registers */
605 605
 	myson->regs = ioremap ( pci->membase, MYSON_BAR_SIZE );
606
+	if ( ! myson->regs ) {
607
+		rc = -ENODEV;
608
+		goto err_ioremap;
609
+	}
606 610
 
607 611
 	/* Reset the NIC */
608 612
 	if ( ( rc = myson_reset ( myson ) ) != 0 )
@@ -627,6 +631,7 @@ static int myson_probe ( struct pci_device *pci ) {
627 631
 	myson_reset ( myson );
628 632
  err_reset:
629 633
 	iounmap ( myson->regs );
634
+ err_ioremap:
630 635
 	netdev_nullify ( netdev );
631 636
 	netdev_put ( netdev );
632 637
  err_alloc:

Loading…
Cancel
Save