[myson] Check for ioremap() failures

Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/20/merge
Michael Brown 2014-07-16 15:53:43 +01:00
parent 022ef91984
commit 720ae17aa4
1 changed files with 5 additions and 0 deletions

View 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: