Skip to contentSkip to conversation

airo: Fix an error path memory leak

PATCH New Michal Schmidt 1 participant 1 message Mar 16, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 airo: Fix an error path memory leak

The airo driver leaks memory if request_irq() fails.

drivers/net/wireless/airo.c +3 -1
index 71ac1f1..0d5b433 100644
@@ -2850,7 +2850,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
 	if (rc) {
 		airo_print_err(dev->name, "register interrupt %d failed, rc %d",
 				irq, rc);
-		goto err_out_unlink;
+		goto err_out_nets;
 	}
 	if (!is_pcmcia) {
 		if (!request_region( dev->base_addr, 64, dev->name )) {
@@ -2933,6 +2933,8 @@ err_out_res:
 	        release_region( dev->base_addr, 64 );
 err_out_irq:
 	free_irq(dev->irq, dev);
+err_out_nets:
+	airo_networks_free(ai);
 err_out_unlink:
 	del_airo_dev(dev);
 err_out_thr: