Commit 3fb95e56 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9a62c65
...@@ -524,6 +524,7 @@ int wl_pci_setup( struct pci_dev *pdev ) ...@@ -524,6 +524,7 @@ int wl_pci_setup( struct pci_dev *pdev )
/* Make sure that space was allocated for our private adapter struct */ /* Make sure that space was allocated for our private adapter struct */
if( dev->priv == NULL ) { if( dev->priv == NULL ) {
DBG_ERROR( DbgInfo, "Private adapter struct was not allocated!!!\n" ); DBG_ERROR( DbgInfo, "Private adapter struct was not allocated!!!\n" );
wl_device_dealloc(dev);
DBG_LEAVE( DbgInfo ); DBG_LEAVE( DbgInfo );
return -ENOMEM; return -ENOMEM;
} }
...@@ -532,6 +533,7 @@ int wl_pci_setup( struct pci_dev *pdev ) ...@@ -532,6 +533,7 @@ int wl_pci_setup( struct pci_dev *pdev )
/* Allocate DMA Descriptors */ /* Allocate DMA Descriptors */
if( wl_pci_dma_alloc( pdev, dev->priv ) < 0 ) { if( wl_pci_dma_alloc( pdev, dev->priv ) < 0 ) {
DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" ); DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" );
wl_device_dealloc(dev);
DBG_LEAVE( DbgInfo ); DBG_LEAVE( DbgInfo );
return -ENOMEM; return -ENOMEM;
} }
...@@ -561,6 +563,8 @@ int wl_pci_setup( struct pci_dev *pdev ) ...@@ -561,6 +563,8 @@ int wl_pci_setup( struct pci_dev *pdev )
result = request_irq(dev->irq, wl_isr, SA_SHIRQ, dev->name, dev); result = request_irq(dev->irq, wl_isr, SA_SHIRQ, dev->name, dev);
if( result ) { if( result ) {
DBG_WARNING( DbgInfo, "Could not register ISR!!!\n" ); DBG_WARNING( DbgInfo, "Could not register ISR!!!\n" );
wl_remove(dev);
wl_device_dealloc(dev);
DBG_LEAVE( DbgInfo ); DBG_LEAVE( DbgInfo );
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment