Skip to content

Commit

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

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

/* Reset the NIC */
if ( ( rc = skeleton_reset ( skel ) ) != 0 )
Expand Down Expand Up @@ -269,6 +273,7 @@ static int skeleton_probe ( struct pci_device *pci ) {
skeleton_reset ( skel );
err_reset:
iounmap ( skel->regs );
err_ioremap:
netdev_nullify ( netdev );
netdev_put ( netdev );
err_alloc:
Expand Down

0 comments on commit 022ef91

Please sign in to comment.