]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[myson] Check for ioremap() failures
authorMichael Brown <mcb30@ipxe.org>
Wed, 16 Jul 2014 14:53:43 +0000 (15:53 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 16 Jul 2014 14:53:43 +0000 (15:53 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/myson.c

index 237f8721056158e6661bd5b1704dad69b9eb8f8d..6abb55660b7007990ac5c91b805b1dcdd7280937 100644 (file)
@@ -603,6 +603,10 @@ static int myson_probe ( struct pci_device *pci ) {
 
        /* Map registers */
        myson->regs = ioremap ( pci->membase, MYSON_BAR_SIZE );
+       if ( ! myson->regs ) {
+               rc = -ENODEV;
+               goto err_ioremap;
+       }
 
        /* Reset the NIC */
        if ( ( rc = myson_reset ( myson ) ) != 0 )
@@ -627,6 +631,7 @@ static int myson_probe ( struct pci_device *pci ) {
        myson_reset ( myson );
  err_reset:
        iounmap ( myson->regs );
+ err_ioremap:
        netdev_nullify ( netdev );
        netdev_put ( netdev );
  err_alloc: