mirror of https://github.com/ipxe/ipxe.git
[intel] Check for ioremap() failures
Debugged-by: Anton D. Kachalov <mouse@yandex-team.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/20/merge
parent
ae778091ca
commit
9ce2b56af6
|
@ -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:
|
||||
|
|
|
@ -400,6 +400,10 @@ static int intelx_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 = intelx_reset ( intel ) ) != 0 )
|
||||
|
@ -424,6 +428,7 @@ static int intelx_probe ( struct pci_device *pci ) {
|
|||
intelx_reset ( intel );
|
||||
err_reset:
|
||||
iounmap ( intel->regs );
|
||||
err_ioremap:
|
||||
netdev_nullify ( netdev );
|
||||
netdev_put ( netdev );
|
||||
err_alloc:
|
||||
|
|
Loading…
Reference in New Issue