[intel] Check for ioremap() failures

Debugged-by: Anton D. Kachalov <mouse@yandex-team.ru>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2014-07-16 15:49:08 +01:00
parent ae778091ca
commit 9ce2b56af6
2 changed files with 10 additions and 0 deletions

View File

@@ -819,6 +819,10 @@ static int intel_probe ( struct pci_device *pci ) {
/* Map registers */
intel->regs = ioremap ( pci->membase, INTEL_BAR_SIZE );
if ( ! intel->regs ) {
rc = -ENODEV;
goto err_ioremap;
}
/* Reset the NIC */
if ( ( rc = intel_reset ( intel ) ) != 0 )
@@ -843,6 +847,7 @@ static int intel_probe ( struct pci_device *pci ) {
intel_reset ( intel );
err_reset:
iounmap ( intel->regs );
err_ioremap:
netdev_nullify ( netdev );
netdev_put ( netdev );
err_alloc: