* [PATCH] net: hns: Add missing fwnode_handle_put in hns_mac_init
@ 2022-04-21 5:53 Peng Wu
2022-04-25 10:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Peng Wu @ 2022-04-21 5:53 UTC (permalink / raw)
To: yisen.zhuang, salil.mehta, huangguangbin2, shenyang39, lipeng321
Cc: netdev, linux-kernel, wupeng58, liwei391
In one of the error paths of the device_for_each_child_node() loop
in hns_mac_init, add missing call to fwnode_handle_put.
Signed-off-by: Peng Wu <wupeng58@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 7edf8569514c..928d934cb21a 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -1065,19 +1065,23 @@ int hns_mac_init(struct dsaf_device *dsaf_dev)
device_for_each_child_node(dsaf_dev->dev, child) {
ret = fwnode_property_read_u32(child, "reg", &port_id);
if (ret) {
+ fwnode_handle_put(child);
dev_err(dsaf_dev->dev,
"get reg fail, ret=%d!\n", ret);
return ret;
}
if (port_id >= max_port_num) {
+ fwnode_handle_put(child);
dev_err(dsaf_dev->dev,
"reg(%u) out of range!\n", port_id);
return -EINVAL;
}
mac_cb = devm_kzalloc(dsaf_dev->dev, sizeof(*mac_cb),
GFP_KERNEL);
- if (!mac_cb)
+ if (!mac_cb) {
+ fwnode_handle_put(child);
return -ENOMEM;
+ }
mac_cb->fw_port = child;
mac_cb->mac_id = (u8)port_id;
dsaf_dev->mac_cb[port_id] = mac_cb;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: hns: Add missing fwnode_handle_put in hns_mac_init
2022-04-21 5:53 [PATCH] net: hns: Add missing fwnode_handle_put in hns_mac_init Peng Wu
@ 2022-04-25 10:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-25 10:10 UTC (permalink / raw)
To: Peng Wu
Cc: yisen.zhuang, salil.mehta, huangguangbin2, shenyang39, lipeng321,
netdev, linux-kernel, liwei391
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Thu, 21 Apr 2022 05:53:44 +0000 you wrote:
> In one of the error paths of the device_for_each_child_node() loop
> in hns_mac_init, add missing call to fwnode_handle_put.
>
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
> ---
> drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
Here is the summary with links:
- net: hns: Add missing fwnode_handle_put in hns_mac_init
https://git.kernel.org/netdev/net/c/e85f8a9f1625
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 10:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 5:53 [PATCH] net: hns: Add missing fwnode_handle_put in hns_mac_init Peng Wu
2022-04-25 10:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).