mirror of
https://github.com/ipxe/ipxe
synced 2025-12-08 10:20:24 +03:00
[myson] Check for ioremap() failures
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user