Commit 5680cf8d authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jakub Kicinski

net: hisilicon: hns_dsaf_mac: fix OF node leak in hns_mac_get_info()

Driver is leaking OF node reference from
of_parse_phandle_with_fixed_args() in hns_mac_get_info().
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240827144421.52852-3-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 17555297
...@@ -933,6 +933,7 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb) ...@@ -933,6 +933,7 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
mac_cb->cpld_ctrl = NULL; mac_cb->cpld_ctrl = NULL;
} else { } else {
syscon = syscon_node_to_regmap(cpld_args.np); syscon = syscon_node_to_regmap(cpld_args.np);
of_node_put(cpld_args.np);
if (IS_ERR_OR_NULL(syscon)) { if (IS_ERR_OR_NULL(syscon)) {
dev_dbg(mac_cb->dev, "no cpld-syscon found!\n"); dev_dbg(mac_cb->dev, "no cpld-syscon found!\n");
mac_cb->cpld_ctrl = NULL; mac_cb->cpld_ctrl = NULL;
......
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