Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2458980imd; Fri, 2 Nov 2018 11:46:01 -0700 (PDT) X-Google-Smtp-Source: AJdET5eafjII1YFq9lCtHe2F5PJZNKArAtw5K9IC27PlEc9zGU1RdEByyOn1synSQBe0F+384VkR X-Received: by 2002:a17:902:2468:: with SMTP id m37-v6mr12910285plg.154.1541184361823; Fri, 02 Nov 2018 11:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184361; cv=none; d=google.com; s=arc-20160816; b=wtWrOe1p6jMd1weIH/o9//vbn6E6A7t+Embnm5n4ZDvLojXeSGojyRARFPDJsQxdj6 B+KmYeVPfxJbdy9PhuDqTwyPzJvVuAFx8A2GoyrskjHrel1bL6tc3GxBbR+XJf1Kx+Jy vMwiI+V4+50jnrpMcX3uBU52kxywDW66XbkXf0y465v5atkPsfdvG9klgkpUOfn7O3jy rMqaopxbUeZfpdwI6NC5XiXLMiE8w496ROmKtcBIV29dPrV64VPc06s0do8Ncn5I4X7V kS66vs7zDDIjcBgpRVYP/ZbrejrWtRdDQc0+xufo8pT7MlOcgJU6cAs3pEI3I6CsP05+ leFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xB7i455iPKGa8wW0PjVbYoTCM6jmQoJ49V1mBkwhe70=; b=0wLxbF3V026T9/pNzxo4/L+KgYCgcNG6iKuTNytP7UalAVWxFWDkC/aL3TdjqwTWf+ HMeX2XaO5bA/TkiUzGElhjCF7hTN7c6PlnJmLFBIeaGRuIJPPC5/bsOzICecf2zKO/Q6 Id6GqTJeGnY2dWM4RGoxslYptWwxrF+jqukNS7DUiy8FTK7mJDpQPCAC+17EAJRAOwVA PLkL3+Lhyszr7RlAi+lk6IkYT/WFWOt7agqEE2RNgpwwgebk3P2OqgJ7pTcoCEX98Vdw 113S4Rxv8ae2VHNsKnmQzVCyzOVHxovT4mrDpVdDuOivRwRhutxmvpJaLWhTkLc7GcGC bSxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="upS/hjKn"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si100524pga.440.2018.11.02.11.45.46; Fri, 02 Nov 2018 11:46:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="upS/hjKn"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730050AbeKCDwx (ORCPT + 99 others); Fri, 2 Nov 2018 23:52:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:48180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbeKCDwx (ORCPT ); Fri, 2 Nov 2018 23:52:53 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A37452084A; Fri, 2 Nov 2018 18:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184280; bh=xT9gGXSyZc95FO1Kkxf56mZHySZq842+rlWAZkGRhnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=upS/hjKngYvpmGvunscsPshrGTOED5FPMjnYSob8YRy+rVQ1LvXyyToEVhsCqWJlU KJ8vTgp7DD6/9ZL5PLCwIFQbBELcI2mIAFj5LVRQN8pB9yMmamebuEJzXlJJENaaVF ccRlKy+K2qMVYiOtVsvU9OQuT8EWow416pOtNcEc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arthur Kiyanovski , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 088/150] net: ena: fix warning in rmmod caused by double iounmap Date: Fri, 2 Nov 2018 19:34:10 +0100 Message-Id: <20181102182909.623090841@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d79c3888bde6581da7ff9f9d6f581900ecb5e632 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 1b01cd2820ba..7093b661c50e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3128,15 +3128,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); } -- 2.17.1