mirror of https://github.com/ipxe/ipxe.git
[myson] Check for ioremap() failures
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/20/merge
parent
022ef91984
commit
720ae17aa4
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue