Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/staging/wlags49_h2/wl_pci.c: add missing wl_device_dealloc and wl_remove

The need for wl_device_dealloc is motivated by the error-handling code for
the failure of wl_adapter_insert. The need for wl_remove in the third case
is motivated by the code in the definition of wl_pci_remove.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Julia Lawall and committed by
Greg Kroah-Hartman
3fb95e56 b9a62c65

+4
+4
drivers/staging/wlags49_h2/wl_pci.c
··· 524 524 /* Make sure that space was allocated for our private adapter struct */ 525 525 if( dev->priv == NULL ) { 526 526 DBG_ERROR( DbgInfo, "Private adapter struct was not allocated!!!\n" ); 527 + wl_device_dealloc(dev); 527 528 DBG_LEAVE( DbgInfo ); 528 529 return -ENOMEM; 529 530 } ··· 533 532 /* Allocate DMA Descriptors */ 534 533 if( wl_pci_dma_alloc( pdev, dev->priv ) < 0 ) { 535 534 DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" ); 535 + wl_device_dealloc(dev); 536 536 DBG_LEAVE( DbgInfo ); 537 537 return -ENOMEM; 538 538 } ··· 563 561 result = request_irq(dev->irq, wl_isr, SA_SHIRQ, dev->name, dev); 564 562 if( result ) { 565 563 DBG_WARNING( DbgInfo, "Could not register ISR!!!\n" ); 564 + wl_remove(dev); 565 + wl_device_dealloc(dev); 566 566 DBG_LEAVE( DbgInfo ); 567 567 return result; 568 568 }