Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp827906ybl; Wed, 11 Dec 2019 08:06:56 -0800 (PST) X-Google-Smtp-Source: APXvYqy+b+tGDERxx+wATC1bJfCHPuQd+Br5nJhwIIJzmiBj3aGGmz2yzzJKOXskAxggvGv9KyO9 X-Received: by 2002:aca:d15:: with SMTP id 21mr3517123oin.177.1576080416230; Wed, 11 Dec 2019 08:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080416; cv=none; d=google.com; s=arc-20160816; b=HV1137W0xpddjXtOz/u2pf7wLEN3ONuljYPYgdJy7e85gPzuAfbN2+w3S4bWM51ewa Phl6CcNzM3m55wwNVd45tNRfKQbKMEg/oOt8Vq6zP1CNOZoh8+0Fy7ZfuUTr1ZJGcFeE U+BBqM+vLVgkUqgYyFz2oAA0lUd10RI899B8zMJ1tHjKpSsb1Ou/INErmwWuxxTQ/S2v GdCveeq1ICZp7rFrSOI6KyqvnIcS5ttV10Fm8hyuRr7+vK1NF7EwRwUgJKce0Exsc0Cu aKSydfakcFkzvHlNK/A8x1eT1lAr8k0fNQ9rs9UPezw5K57Pg4JWPtYonVKoRuZs3QIc GhVQ== 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=GonxWGDQnnAa6SuBfhCy30qhD5egK0puyuzKUtGQf64=; b=bnAQD9Qtj/tCt0OSoswccpRg5YWO7kOIgbZzXXTxIKl+2u8UvvZn6y0gUMFjGrwYPu VFRZIrU/GJA5taerHqjfX3ArYMpbqLuLf73Iv6zrbTQQV5DyPIRCp4Cqrq3glArDryFW 6A1qh/7GOhaEwKaH7TcE9Ubut8Tmy92I+qxoLoQAJZ9+xw3hYbx5vCbkqUT0Y2ZqsvDM Vb+xIC1Kgtbin/5m+LQQVNbWwzAqS0oEiEbFAxMtJ0RulswIZ+fgCZS+JKUutS5G5veO orcRy7C1Gjr5hLfUGkjn/42ItBRLhtsNc7qawUNK5QBC5LSvKVB6Z8gq7D4exASrKbCz TcCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yiQZP+6w; 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 a22si66130otr.143.2019.12.11.08.06.43; Wed, 11 Dec 2019 08:06:56 -0800 (PST) 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=yiQZP+6w; 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 S2388884AbfLKQFT (ORCPT + 99 others); Wed, 11 Dec 2019 11:05:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:35250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731244AbfLKPMw (ORCPT ); Wed, 11 Dec 2019 10:12:52 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 E444F24654; Wed, 11 Dec 2019 15:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077171; bh=9PI1QPNR2iHRgZayRSUSeas2bsFCkeZ0CrEQq7RCfcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yiQZP+6wImaN9kCHENsBEoTRscIb9PxiJZI09kqU707mN9/HBqmqKCCXbQ17vp8yc kl+5RuqjR4vE+a0IUKvX1pP+d1oWo/Vm8LAFrh9/o9TJRwG/BL6jPmwJkx7iiyN3+D TGJUGenFvykaXS/O4Nx53pGgwBRouC3mKrlitGg4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.3 042/105] net: ep93xx_eth: fix mismatch of request_mem_region in remove Date: Wed, 11 Dec 2019 16:05:31 +0100 Message-Id: <20191211150237.980765149@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Chuhong Yuan [ Upstream commit 3df70afe8d33f4977d0e0891bdcfb639320b5257 ] The driver calls release_resource in remove to match request_mem_region in probe, which is incorrect. Fix it by using the right one, release_mem_region. Signed-off-by: Chuhong Yuan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cirrus/ep93xx_eth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c b/drivers/net/ethernet/cirrus/ep93xx_eth.c index f1a0c4dceda0c..f37c9a08c4cf5 100644 --- a/drivers/net/ethernet/cirrus/ep93xx_eth.c +++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c @@ -763,6 +763,7 @@ static int ep93xx_eth_remove(struct platform_device *pdev) { struct net_device *dev; struct ep93xx_priv *ep; + struct resource *mem; dev = platform_get_drvdata(pdev); if (dev == NULL) @@ -778,8 +779,8 @@ static int ep93xx_eth_remove(struct platform_device *pdev) iounmap(ep->base_addr); if (ep->res != NULL) { - release_resource(ep->res); - kfree(ep->res); + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + release_mem_region(mem->start, resource_size(mem)); } free_netdev(dev); -- 2.20.1