Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[realtek] Check for ioremap() failures
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jul 16, 2014
1 parent 9ce2b56 commit 857e4f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/drivers/net/realtek.c
Expand Up @@ -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 )
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 857e4f5

Please sign in to comment.