Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[hermon] Add missing iounmap()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 20, 2016
1 parent 750a2ef commit e2cdbd5
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions src/drivers/infiniband/hermon.c
Expand Up @@ -3747,24 +3747,6 @@ static void hermon_free ( struct hermon *hermon ) {
free ( hermon );
}

/**
* Initialise Hermon PCI parameters
*
* @v hermon Hermon device
*/
static void hermon_pci_init ( struct hermon *hermon ) {
struct pci_device *pci = hermon->pci;

/* Fix up PCI device */
adjust_pci_device ( pci );

/* Get PCI BARs */
hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR),
HERMON_PCI_CONFIG_BAR_SIZE );
hermon->uar = ioremap ( pci_bar_start ( pci, HERMON_PCI_UAR_BAR ),
HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );
}

/**
* Probe PCI device
*
Expand All @@ -3789,8 +3771,14 @@ static int hermon_probe ( struct pci_device *pci ) {
pci_set_drvdata ( pci, hermon );
hermon->pci = pci;

/* Initialise PCI parameters */
hermon_pci_init ( hermon );
/* Fix up PCI device */
adjust_pci_device ( pci );

/* Map PCI BARs */
hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
HERMON_PCI_CONFIG_BAR_SIZE );
hermon->uar = ioremap ( pci_bar_start ( pci, HERMON_PCI_UAR_BAR ),
HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );

/* Reset device */
hermon_reset ( hermon );
Expand Down Expand Up @@ -3885,6 +3873,8 @@ static int hermon_probe ( struct pci_device *pci ) {
err_get_cap:
hermon_stop_firmware ( hermon );
err_start_firmware:
iounmap ( hermon->uar );
iounmap ( hermon->config );
hermon_free ( hermon );
err_alloc:
return rc;
Expand All @@ -3910,6 +3900,8 @@ static void hermon_remove ( struct pci_device *pci ) {
}
for ( i = ( hermon->cap.num_ports - 1 ) ; i >= 0 ; i-- )
ibdev_put ( hermon->port[i].ibdev );
iounmap ( hermon->uar );
iounmap ( hermon->config );
hermon_free ( hermon );
}

Expand All @@ -3933,8 +3925,12 @@ static int hermon_bofm_probe ( struct pci_device *pci ) {
pci_set_drvdata ( pci, hermon );
hermon->pci = pci;

/* Initialise PCI parameters */
hermon_pci_init ( hermon );
/* Fix up PCI device */
adjust_pci_device ( pci );

/* Map PCI BAR */
hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
HERMON_PCI_CONFIG_BAR_SIZE );

/* Initialise BOFM device */
bofm_init ( &hermon->bofm, pci, &hermon_bofm_operations );
Expand All @@ -3949,6 +3945,7 @@ static int hermon_bofm_probe ( struct pci_device *pci ) {
return 0;

err_bofm_register:
iounmap ( hermon->config );
hermon_free ( hermon );
err_alloc:
return rc;
Expand All @@ -3963,6 +3960,7 @@ static void hermon_bofm_remove ( struct pci_device *pci ) {
struct hermon *hermon = pci_get_drvdata ( pci );

bofm_unregister ( &hermon->bofm );
iounmap ( hermon->config );
hermon_free ( hermon );
}

Expand Down

0 comments on commit e2cdbd5

Please sign in to comment.