summaryrefslogtreecommitdiff
path: root/drivers/staging/wlags49_h2
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-04-19 13:03:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-20 08:31:49 -0700
commit3fb95e564e535a1614f7cea1ac194f312eb0d2b8 (patch)
treea5fff55e3149f75c55050ffe33f27500c82ec71c /drivers/staging/wlags49_h2
parentb9a62c650b41365cd1f6214496bc91f152c723a4 (diff)
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>
Diffstat (limited to 'drivers/staging/wlags49_h2')
-rw-r--r--drivers/staging/wlags49_h2/wl_pci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/wlags49_h2/wl_pci.c b/drivers/staging/wlags49_h2/wl_pci.c
index 3df990c7306a..0b31b01bd490 100644
--- a/drivers/staging/wlags49_h2/wl_pci.c
+++ b/drivers/staging/wlags49_h2/wl_pci.c
@@ -524,6 +524,7 @@ int wl_pci_setup( struct pci_dev *pdev )
/* Make sure that space was allocated for our private adapter struct */
if( dev->priv == NULL ) {
DBG_ERROR( DbgInfo, "Private adapter struct was not allocated!!!\n" );
+ wl_device_dealloc(dev);
DBG_LEAVE( DbgInfo );
return -ENOMEM;
}
@@ -532,6 +533,7 @@ int wl_pci_setup( struct pci_dev *pdev )
/* Allocate DMA Descriptors */
if( wl_pci_dma_alloc( pdev, dev->priv ) < 0 ) {
DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" );
+ wl_device_dealloc(dev);
DBG_LEAVE( DbgInfo );
return -ENOMEM;
}
@@ -561,6 +563,8 @@ int wl_pci_setup( struct pci_dev *pdev )
result = request_irq(dev->irq, wl_isr, SA_SHIRQ, dev->name, dev);
if( result ) {
DBG_WARNING( DbgInfo, "Could not register ISR!!!\n" );
+ wl_remove(dev);
+ wl_device_dealloc(dev);
DBG_LEAVE( DbgInfo );
return result;
}