[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

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: