lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181008.105653.2116602743772544221.davem@davemloft.net>
Date:   Mon, 08 Oct 2018 10:56:53 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     akiyano@...zon.com
Cc:     netdev@...r.kernel.org, dwmw@...zon.com, zorik@...zon.com,
        matua@...zon.com, saeedb@...zon.com, msw@...zon.com,
        aliguori@...zon.com, nafea@...zon.com, gtzalik@...zon.com,
        netanel@...zon.com, alisaidi@...zon.com
Subject: Re: [PATCH V1 net 2/5] net: ena: fix warning in rmmod caused by
 double iounmap

From: <akiyano@...zon.com>
Date: Mon, 8 Oct 2018 15:28:41 +0300

> From: Arthur Kiyanovski <akiyano@...zon.com>
> 
> 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.
> 
> Signed-off-by: Arthur Kiyanovski <akiyano@...zon.com>
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> index 25621a2..23f2dda 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -3099,15 +3099,7 @@ 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;
> -
> -	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;
> +	int release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;
>  	pci_release_selected_regions(pdev, release_bars);

Always have an empty line between local variable declarations and actual
function code.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ