david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[realtek] Check for ioremap() failures

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-07-16 15:50:18 +01:00
parent 9ce2b56af6
commit 857e4f56a7
1 changed files with 5 additions and 0 deletions

View File

@ -1119,6 +1119,10 @@ static int realtek_probe ( struct pci_device *pci ) {
/* Map registers */
rtl->regs = ioremap ( pci->membase, RTL_BAR_SIZE );
if ( ! rtl->regs ) {
rc = -ENODEV;
goto err_ioremap;
}
/* Reset the NIC */
if ( ( rc = realtek_reset ( rtl ) ) != 0 )
@ -1177,6 +1181,7 @@ static int realtek_probe ( struct pci_device *pci ) {
realtek_reset ( rtl );
err_reset:
iounmap ( rtl->regs );
err_ioremap:
netdev_nullify ( netdev );
netdev_put ( netdev );
err_alloc: