mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 20:40:25 +03:00
[skel] Check for ioremap() failures
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user