summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amazon/ena/ena_netdev.c
diff options
context:
space:
mode:
authorArthur Kiyanovski2018-10-09 10:21:27 +0200
committerDavid S. Miller2018-10-09 19:49:49 +0200
commitd79c3888bde6581da7ff9f9d6f581900ecb5e632 (patch)
treea3a93a98d12134f6e5e2346e112de757d54e97bd /drivers/net/ethernet/amazon/ena/ena_netdev.c
parentMerge branch 'net-smc-userspace-breakage-fixes' (diff)
downloadkernel-qcow2-linux-d79c3888bde6581da7ff9f9d6f581900ecb5e632.tar.gz
kernel-qcow2-linux-d79c3888bde6581da7ff9f9d6f581900ecb5e632.tar.xz
kernel-qcow2-linux-d79c3888bde6581da7ff9f9d6f581900ecb5e632.zip
net: ena: fix warning in rmmod caused by double iounmap
Memory mapped with devm_ioremap is automatically freed when the driver is disconnected from the device. Therefore there is no need to explicitly call devm_iounmap. Fixes: 0857d92f71b6 ("net: ena: add missing unmap bars on device removal") Fixes: 411838e7b41c ("net: ena: fix rare kernel crash when bar memory remap fails") Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amazon/ena/ena_netdev.c')
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_netdev.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 25621a218f20..78d84ca0a378 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -3099,15 +3099,8 @@ err_rss_init:
static void ena_release_bars(struct ena_com_dev *ena_dev, struct pci_dev *pdev)
{
- int release_bars;
+ int release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;
- if (ena_dev->mem_bar)
- devm_iounmap(&pdev->dev, ena_dev->mem_bar);
-
- if (ena_dev->reg_bar)
- devm_iounmap(&pdev->dev, ena_dev->reg_bar);
-
- release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;
pci_release_selected_regions(pdev, release_bars);
}