mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 19:49:45 +03:00
[realtek] Check for ioremap() failures
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -1119,6 +1119,10 @@ static int realtek_probe ( struct pci_device *pci ) {
|
|||||||
|
|
||||||
/* Map registers */
|
/* Map registers */
|
||||||
rtl->regs = ioremap ( pci->membase, RTL_BAR_SIZE );
|
rtl->regs = ioremap ( pci->membase, RTL_BAR_SIZE );
|
||||||
|
if ( ! rtl->regs ) {
|
||||||
|
rc = -ENODEV;
|
||||||
|
goto err_ioremap;
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset the NIC */
|
/* Reset the NIC */
|
||||||
if ( ( rc = realtek_reset ( rtl ) ) != 0 )
|
if ( ( rc = realtek_reset ( rtl ) ) != 0 )
|
||||||
@@ -1177,6 +1181,7 @@ static int realtek_probe ( struct pci_device *pci ) {
|
|||||||
realtek_reset ( rtl );
|
realtek_reset ( rtl );
|
||||||
err_reset:
|
err_reset:
|
||||||
iounmap ( rtl->regs );
|
iounmap ( rtl->regs );
|
||||||
|
err_ioremap:
|
||||||
netdev_nullify ( netdev );
|
netdev_nullify ( netdev );
|
||||||
netdev_put ( netdev );
|
netdev_put ( netdev );
|
||||||
err_alloc:
|
err_alloc:
|
||||||
|
|||||||
Reference in New Issue
Block a user