david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[skel] Check for ioremap() failures

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-07-16 15:52:48 +01:00
parent 7ab3035749
commit 022ef91984
1 changed files with 5 additions and 0 deletions

View File

@ -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 )
@ -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: