Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2048745ima; Mon, 22 Oct 2018 03:24:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV60fMmzDlYX84HGpqeD6UQG/VgyZGOfE0LCt6T92v0em98j7WlJkYcEKdYJIBw1t8RRKr8oM X-Received: by 2002:a62:1f9d:: with SMTP id l29-v6mr44288986pfj.121.1540203850676; Mon, 22 Oct 2018 03:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540203850; cv=none; d=google.com; s=arc-20160816; b=1FIwIQxXeOZr0+PUtOOojv6c+m5p0q+maWgX/zxQtmN5ohvxLEP21iWp/GRMdoxaE9 vUyJNNUIWbk96tJOCT0WbB0jUvBNHbK2rQyPG8+O284iz0ZlQzwCQbhiPpdN3J7ebaYK 1Bm6/6xOV3z1d91dxot4R5Ce9VbKfyjjLp5/PjePLzZL3lQoeCBv4loOx75LVFpXXIhb PiufTmsJ6cNlwkSaVJPQZOZVcAZ83G1bLxpylzJA/K0R7fjFL4WrqTMXJ+aMMVZbJXG7 vtQT/H76LmxWDARyR+YZ71AQ7b4nCVV4Gi9QBUOZ3m83BBb0dxaXxt7u9GzB7v3d/EiN qMWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=sSBU2bqJWoXJvZHo81FNUX/ixnIntmnxpv9Q96lE/Pw=; b=dhJl2jAi9+rFdEii6r5jP591wbSksp4D/e7KkzQur7ylSf+VqnjZo1p5rrJhH9k5fK eSJl9qMDM6/y2ngn8es7BRvC5fH91YB+u/iQnVDezS+1/cTMPNIWugSAe4rszdwiCbVp 00xNDx5tqhLgg8LI/bu9nPlm2naFFq6zYGhFChJhl+V1V8vDZFX0Ow96mdcHI17x4h4F DTWarM1MquRfW22xF86+NsQ+oeufrX0Mzr4NsG7NW2lWNKJcH6oJTecs/F55MOyDILbJ KbS0qEuINLqf4ryzS1CgaEdSD88XoiSnCeCOvjI8Xb4Y8uHqaYsLQG94WvksSe8DDUEo 7hmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M+g3056g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g20-v6si32520488plq.192.2018.10.22.03.23.56; Mon, 22 Oct 2018 03:24:10 -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=M+g3056g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729158AbeJVSix (ORCPT + 99 others); Mon, 22 Oct 2018 14:38:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:49824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729148AbeJVSiv (ORCPT ); Mon, 22 Oct 2018 14:38:51 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6448B20658; Mon, 22 Oct 2018 10:20:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540203656; bh=NW0uo5cHnPAbzvX8QAg1GdJxyXxuzmsBbnidTpCufp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M+g3056gEO2CVvCsNorv7MMKjy8prOSMBkvSTAucwGk3cOuzeF8vR+mT1PMuj6QNW iAuyYDqJQHasxXwfg04GL26pwAKC4hVQzXGKKXDg97332Lp/FUCGgjKUVTH29Kk1pD X1YxVJvZ8swbq0BygKHxWv3MfbMix1U6Wd6IuPSQ= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arthur Kiyanovski , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.14 11/15] net: ena: fix warning in rmmod caused by double iounmap Date: Mon, 22 Oct 2018 06:20:22 -0400 Message-Id: <20181022102026.40869-11-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181022102026.40869-1-sashal@kernel.org> References: <20181022102026.40869-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arthur Kiyanovski [ 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 60b3ee29d82c..08c9c99a8331 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3059,15 +3059,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); } -- 2.17.1