Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[natsemi] Check for ioremap() failures
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jul 16, 2014
1 parent 720ae17 commit 3a02409
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/drivers/net/natsemi.c
Expand Up @@ -854,6 +854,10 @@ static int natsemi_probe ( struct pci_device *pci ) {

/* Map registers */
natsemi->regs = ioremap ( pci->membase, NATSEMI_BAR_SIZE );
if ( ! natsemi->regs ) {
rc = -ENODEV;
goto err_ioremap;
}

/* Reset the NIC */
if ( ( rc = natsemi_reset ( natsemi ) ) != 0 )
Expand Down Expand Up @@ -881,6 +885,7 @@ static int natsemi_probe ( struct pci_device *pci ) {
natsemi_reset ( natsemi );
err_reset:
iounmap ( natsemi->regs );
err_ioremap:
netdev_nullify ( netdev );
netdev_put ( netdev );
err_alloc:
Expand Down

0 comments on commit 3a02409

Please sign in to comment.