Sfoglia il codice sorgente

[realtek] Check for ioremap() failures

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 anni fa
parent
commit
857e4f56a7
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5
    0
      src/drivers/net/realtek.c

+ 5
- 0
src/drivers/net/realtek.c Vedi File

@@ -1119,6 +1119,10 @@ static int realtek_probe ( struct pci_device *pci ) {
1119 1119
 
1120 1120
 	/* Map registers */
1121 1121
 	rtl->regs = ioremap ( pci->membase, RTL_BAR_SIZE );
1122
+	if ( ! rtl->regs ) {
1123
+		rc = -ENODEV;
1124
+		goto err_ioremap;
1125
+	}
1122 1126
 
1123 1127
 	/* Reset the NIC */
1124 1128
 	if ( ( rc = realtek_reset ( rtl ) ) != 0 )
@@ -1177,6 +1181,7 @@ static int realtek_probe ( struct pci_device *pci ) {
1177 1181
 	realtek_reset ( rtl );
1178 1182
  err_reset:
1179 1183
 	iounmap ( rtl->regs );
1184
+ err_ioremap:
1180 1185
 	netdev_nullify ( netdev );
1181 1186
 	netdev_put ( netdev );
1182 1187
  err_alloc:

Loading…
Annulla
Salva