diff options
author | Raghu Vatsavayi <rvatsavayi@caviumnetworks.com> | 2016-11-15 02:54:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-16 06:24:40 +0300 |
commit | 515e752d2b877f79eefb9c512d7ab63f082bbe3a (patch) | |
tree | 59b9f3902a1bfc21f0f76861471393480ae0107f /drivers/net/ethernet/cavium/liquidio/octeon_main.h | |
parent | 86dea55b9aef494b349c5e77e7793a8b2c7d8f1f (diff) | |
download | linux-515e752d2b877f79eefb9c512d7ab63f082bbe3a.tar.xz |
liquidio CN23XX: device states
Cleaned up resource leaks during destroy resources by
introducing more device states.
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>
Signed-off-by: Derek Chickles <derek.chickles@caviumnetworks.com>
Signed-off-by: Satanand Burla <satananda.burla@caviumnetworks.com>
Signed-off-by: Felix Manlunas <felix.manlunas@caviumnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/liquidio/octeon_main.h')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/octeon_main.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_main.h b/drivers/net/ethernet/cavium/liquidio/octeon_main.h index 3cddf285c2b4..3afa61ee3223 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_main.h +++ b/drivers/net/ethernet/cavium/liquidio/octeon_main.h @@ -116,7 +116,7 @@ static inline int octeon_map_pci_barx(struct octeon_device *oct, mapped_len = oct->mmio[baridx].len; if (!mapped_len) - return 1; + goto err_release_region; if (max_map_len && (mapped_len > max_map_len)) mapped_len = max_map_len; @@ -132,11 +132,15 @@ static inline int octeon_map_pci_barx(struct octeon_device *oct, if (!oct->mmio[baridx].hw_addr) { dev_err(&oct->pci_dev->dev, "error ioremap for bar %d\n", baridx); - return 1; + goto err_release_region; } oct->mmio[baridx].done = 1; return 0; + +err_release_region: + pci_release_region(oct->pci_dev, baridx * 2); + return 1; } static inline void * |