Commit 0a48de95 authored by Wang Hai's avatar Wang Hai Committed by Greg Kroah-Hartman

net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe()

[ Upstream commit 85496a29 ]

Fix the missing clk_disable_unprepare() before return
from gemini_ethernet_port_probe() in the error handling case.

Fixes: 4d5ae32f ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5df9e561
...@@ -2451,6 +2451,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) ...@@ -2451,6 +2451,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
port->reset = devm_reset_control_get_exclusive(dev, NULL); port->reset = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(port->reset)) { if (IS_ERR(port->reset)) {
dev_err(dev, "no reset\n"); dev_err(dev, "no reset\n");
clk_disable_unprepare(port->pclk);
return PTR_ERR(port->reset); return PTR_ERR(port->reset);
} }
reset_control_reset(port->reset); reset_control_reset(port->reset);
...@@ -2506,8 +2507,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) ...@@ -2506,8 +2507,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
IRQF_SHARED, IRQF_SHARED,
port_names[port->id], port_names[port->id],
port); port);
if (ret) if (ret) {
clk_disable_unprepare(port->pclk);
return ret; return ret;
}
ret = register_netdev(netdev); ret = register_netdev(netdev);
if (!ret) { if (!ret) {
......
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