Skip to content

Commit

Permalink
net: ena: fix warning in rmmod caused by double iounmap
Browse files Browse the repository at this point in the history
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: 0857d92 ("net: ena: add missing unmap bars on device removal")
Fixes: 411838e ("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>
  • Loading branch information
Arthur Kiyanovski authored and David S. Miller committed Oct 9, 2018
1 parent e2a322a commit d79c388
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/net/ethernet/amazon/ena/ena_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3099,15 +3099,8 @@ static int ena_rss_init_default(struct ena_adapter *adapter)

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);
}

Expand Down

0 comments on commit d79c388

Please sign in to comment.