Commit 6620f17d authored by Arthur Kiyanovski's avatar Arthur Kiyanovski Committed by Khalid Elmously

net: ena: fix warning in rmmod caused by double iounmap

BugLink: http://bugs.launchpad.net/bugs/1798182

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: 0857d92f ("net: ena: add missing unmap bars on device removal")
Fixes: 411838e7 ("net: ena: fix rare kernel crash when bar memory remap fails")
Signed-off-by: default avatarArthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit d79c3888)
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Acked-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Acked-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent c98b7db6
...@@ -3084,15 +3084,8 @@ static int ena_rss_init_default(struct ena_adapter *adapter) ...@@ -3084,15 +3084,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) 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); pci_release_selected_regions(pdev, release_bars);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment