[PATCH] airo: Fix an error path memory leak

The airo driver leaks memory if request_irq() fails.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Michal Schmidt 2007-03-16 12:42:59 +01:00 committed by John W. Linville
parent 21665a69e6
commit 4d881901b8
1 changed files with 3 additions and 1 deletions

View File

@ -2852,7 +2852,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
if (rc) { if (rc) {
airo_print_err(dev->name, "register interrupt %d failed, rc %d", airo_print_err(dev->name, "register interrupt %d failed, rc %d",
irq, rc); irq, rc);
goto err_out_unlink; goto err_out_nets;
} }
if (!is_pcmcia) { if (!is_pcmcia) {
if (!request_region( dev->base_addr, 64, dev->name )) { if (!request_region( dev->base_addr, 64, dev->name )) {
@ -2935,6 +2935,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
release_region( dev->base_addr, 64 ); release_region( dev->base_addr, 64 );
err_out_irq: err_out_irq:
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
err_out_nets:
airo_networks_free(ai);
err_out_unlink: err_out_unlink:
del_airo_dev(dev); del_airo_dev(dev);
err_out_thr: err_out_thr: