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

Loading…
Cancel
Save