Commit 697ac1ba authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Greg Kroah-Hartman

net: ep93xx_eth: fix mismatch of request_mem_region in remove

[ Upstream commit 3df70afe ]

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: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent da0b8029
...@@ -780,6 +780,7 @@ static int ep93xx_eth_remove(struct platform_device *pdev) ...@@ -780,6 +780,7 @@ static int ep93xx_eth_remove(struct platform_device *pdev)
{ {
struct net_device *dev; struct net_device *dev;
struct ep93xx_priv *ep; struct ep93xx_priv *ep;
struct resource *mem;
dev = platform_get_drvdata(pdev); dev = platform_get_drvdata(pdev);
if (dev == NULL) if (dev == NULL)
...@@ -795,8 +796,8 @@ static int ep93xx_eth_remove(struct platform_device *pdev) ...@@ -795,8 +796,8 @@ static int ep93xx_eth_remove(struct platform_device *pdev)
iounmap(ep->base_addr); iounmap(ep->base_addr);
if (ep->res != NULL) { if (ep->res != NULL) {
release_resource(ep->res); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
kfree(ep->res); release_mem_region(mem->start, resource_size(mem));
} }
free_netdev(dev); free_netdev(dev);
......
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