Browse Source

[realtek] Check for ioremap() failures

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
857e4f56a7
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/drivers/net/realtek.c

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

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

Loading…
Cancel
Save