diff mbox series

[1/3] net: hisilicon: hip04: fix OF node leak in probe()

Message ID 20240825185311.109835-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [1/3] net: hisilicon: hip04: fix OF node leak in probe() | expand

Checks

Context Check Description
netdev/series_format warning Series does not have a cover letter; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-25--21-00 (tests: 714)

Commit Message

Krzysztof Kozlowski Aug. 25, 2024, 6:53 p.m. UTC
Driver is leaking OF node reference from
of_parse_phandle_with_fixed_args() in probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/ethernet/hisilicon/hip04_eth.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Markus Elfring Aug. 25, 2024, 7:21 p.m. UTC | #1
> Driver is leaking OF node reference from
> of_parse_phandle_with_fixed_args() in probe().

* Is there a need to improve such a change description another bit?

  + Imperative mood

  * Tags like “Fixes” and “Cc”

* Can a corresponding cover letter help?


Regards,
Markus
Simon Horman Aug. 27, 2024, 2:40 p.m. UTC | #2
On Sun, Aug 25, 2024 at 09:21:31PM +0200, Markus Elfring wrote:
> > Driver is leaking OF node reference from
> > of_parse_phandle_with_fixed_args() in probe().
> 
> * Is there a need to improve such a change description another bit?
> 
>   + Imperative mood
> 
>   * Tags like “Fixes” and “Cc”

I think it would be helpful if these were either explicitly targeted for
net-next without Fixes tags (the assumed state of affairs as-is).

	Subject: [Patch x/n net-next] ...

Or targeted at net, with Fixes tags

	Subject: [Patch x/n net] ...

I guess that in theory these are fixes, as resource leaks could occur.
But perhaps that is more theory that practice. I am unsure.

> * Can a corresponding cover letter help?

I agree that would be nice, it's the usual practice for Networking
patchsets with more than one patch.

The above aside, I looked over the code changes
and I agree they are correct.
Krzysztof Kozlowski Aug. 27, 2024, 2:41 p.m. UTC | #3
On 27/08/2024 16:40, Simon Horman wrote:
> On Sun, Aug 25, 2024 at 09:21:31PM +0200, Markus Elfring wrote:
>>> Driver is leaking OF node reference from
>>> of_parse_phandle_with_fixed_args() in probe().
>>
>> * Is there a need to improve such a change description another bit?
>>
>>   + Imperative mood
>>
>>   * Tags like “Fixes” and “Cc”
> 
> I think it would be helpful if these were either explicitly targeted for
> net-next without Fixes tags (the assumed state of affairs as-is).
> 
> 	Subject: [Patch x/n net-next] ...
> 
> Or targeted at net, with Fixes tags
> 
> 	Subject: [Patch x/n net] ...
> 
> I guess that in theory these are fixes, as resource leaks could occur.
> But perhaps that is more theory that practice. I am unsure.

I'll resend with net-next.


Best regards,
Krzysztof
Simon Horman Aug. 27, 2024, 2:58 p.m. UTC | #4
On Tue, Aug 27, 2024 at 04:41:50PM +0200, Krzysztof Kozlowski wrote:
> On 27/08/2024 16:40, Simon Horman wrote:
> > On Sun, Aug 25, 2024 at 09:21:31PM +0200, Markus Elfring wrote:
> >>> Driver is leaking OF node reference from
> >>> of_parse_phandle_with_fixed_args() in probe().
> >>
> >> * Is there a need to improve such a change description another bit?
> >>
> >>   + Imperative mood
> >>
> >>   * Tags like “Fixes” and “Cc”
> > 
> > I think it would be helpful if these were either explicitly targeted for
> > net-next without Fixes tags (the assumed state of affairs as-is).
> > 
> > 	Subject: [Patch x/n net-next] ...
> > 
> > Or targeted at net, with Fixes tags
> > 
> > 	Subject: [Patch x/n net] ...
> > 
> > I guess that in theory these are fixes, as resource leaks could occur.
> > But perhaps that is more theory that practice. I am unsure.
> 
> I'll resend with net-next.

Thanks, much appreciated.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index b91e7a06b97f..beb815e5289b 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -947,6 +947,7 @@  static int hip04_mac_probe(struct platform_device *pdev)
 	priv->tx_coalesce_timer.function = tx_done;
 
 	priv->map = syscon_node_to_regmap(arg.np);
+	of_node_put(arg.np);
 	if (IS_ERR(priv->map)) {
 		dev_warn(d, "no syscon hisilicon,hip04-ppe\n");
 		ret = PTR_ERR(priv->map);