Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: release the port device node in cvm_oct_probe
@ 2026-11-04  2:14 Wentao Liang
  2026-11-04  7:12 ` Krzysztof Kozlowski
  2026-11-04  7:45 ` Dan Carpenter
  0 siblings, 2 replies; 4+ messages in thread
From: Wentao Liang @ 2026-11-04  2:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging

cvm_oct_probe() looks up the device node of every port with
cvm_oct_node_for_port(), which walks the children with
for_each_child_of_node() and therefore returns the node with an
incremented reference count.  The reference is stored in
priv->of_node and used for the lifetime of the net_device, but it is
never dropped: both probe error paths free the net_device without
releasing the node, and cvm_oct_remove_device() does the same on
unbind.  Each failed or torn down port therefore keeps its device node
referenced forever.

Add the missing of_node_put() in the two probe error paths and in
cvm_oct_remove_device(), which also covers the error cleanup done after
the ports have been registered.  of_node_put() accepts the NULL node of
the POW device.

Fixes: 422d97b8b05e ("Revert "staging: octeon: delete driver"")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/staging/octeon/ethernet.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 42ec4b8324a8..bba46127ef9d 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -114,6 +114,7 @@ static void cvm_oct_remove_device(int port)
 
 		cvm_oct_tx_shutdown_dev(dev);
 		unregister_netdev(dev);
+		of_node_put(priv->of_node);
 		free_netdev(dev);
 		cvm_oct_device[port] = NULL;
 	}
@@ -919,10 +920,12 @@ static int cvm_oct_probe(struct platform_device *pdev)
 			}
 
 			if (!dev->netdev_ops) {
+				of_node_put(priv->of_node);
 				free_netdev(dev);
 			} else if (register_netdev(dev) < 0) {
 				netdev_err(dev, "Failed to register ethernet device for interface %d, port %d\n",
 					   interface, priv->port);
+				of_node_put(priv->of_node);
 				free_netdev(dev);
 			} else {
 				cvm_oct_device[priv->port] = dev;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: octeon: release the port device node in cvm_oct_probe
  2026-11-04  2:14 [PATCH] staging: octeon: release the port device node in cvm_oct_probe Wentao Liang
@ 2026-11-04  7:12 ` Krzysztof Kozlowski
  2026-11-04  7:45 ` Dan Carpenter
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-04  7:12 UTC (permalink / raw)
  To: Wentao Liang; +Cc: Greg Kroah-Hartman, linux-staging


On Wed, 04 Nov 2026 02:14:50 +0000, Wentao Liang wrote:
> cvm_oct_probe() looks up the device node of every port with
> cvm_oct_node_for_port(), which walks the children with
> for_each_child_of_node() and therefore returns the node with an
> incremented reference count.  The reference is stored in
> priv->of_node and used for the lifetime of the net_device, but it is
> never dropped: both probe error paths free the net_device without
> releasing the node, and cvm_oct_remove_device() does the same on
> unbind.  Each failed or torn down port therefore keeps its device node
> referenced forever.
> 
> Add the missing of_node_put() in the two probe error paths and in
> cvm_oct_remove_device(), which also covers the error cleanup done after
> the ports have been registered.  of_node_put() accepts the NULL node of
> the POW device.
> 
> Fixes: 422d97b8b05e ("Revert "staging: octeon: delete driver"")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/staging/octeon/ethernet.c | 3 +++
>  1 file changed, 3 insertions(+)
> 

Multiple things here:
1. Your team ignored completely previous feedback. Multiple times.

2. You use multiple identities with this email address, thus I doubt that we
   speak with an actual person.

3. Your bot does not even bother running checkpatch, right?

4. Nothing of this was reproduced nor tested.

5. Finally, the same feedback:
You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.

This is on the verge of hostile patch: bomb us with so many
contributions, we won't be able to handle them in efficient manner,
like responding ONCE to ask you to slow down.  Considering all this
is untested and LLM generated, I have even more doubts whether this
should be considered for review.

Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.

Best regards,
Krzysztof





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: octeon: release the port device node in cvm_oct_probe
  2026-11-04  2:14 [PATCH] staging: octeon: release the port device node in cvm_oct_probe Wentao Liang
  2026-11-04  7:12 ` Krzysztof Kozlowski
@ 2026-11-04  7:45 ` Dan Carpenter
  2026-11-04  8:34   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2026-11-04  7:45 UTC (permalink / raw)
  To: Wentao Liang; +Cc: Greg Kroah-Hartman, linux-staging

On Wed, Nov 04, 2026 at 02:14:50AM +0000, Wentao Liang wrote:
> cvm_oct_probe() looks up the device node of every port with
> cvm_oct_node_for_port(), which walks the children with
> for_each_child_of_node() and therefore returns the node with an
> incremented reference count.  The reference is stored in
> priv->of_node and used for the lifetime of the net_device, but it is
> never dropped: both probe error paths free the net_device without
> releasing the node, and cvm_oct_remove_device() does the same on
> unbind.  Each failed or torn down port therefore keeps its device node
> referenced forever.
> 
> Add the missing of_node_put() in the two probe error paths and in
> cvm_oct_remove_device(), which also covers the error cleanup done after
> the ports have been registered.  of_node_put() accepts the NULL node of
> the POW device.
> 
> Fixes: 422d97b8b05e ("Revert "staging: octeon: delete driver"")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

Normally with firmware, we just take a reference to the firmware node,
read the information we need to probe, and then release the reference.

Is there any need to hold the reference here until basically the system
shuts down?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: octeon: release the port device node in cvm_oct_probe
  2026-11-04  7:45 ` Dan Carpenter
@ 2026-11-04  8:34   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-04  8:34 UTC (permalink / raw)
  To: Dan Carpenter, Wentao Liang; +Cc: Greg Kroah-Hartman, linux-staging

On 04/11/2026 08:45, Dan Carpenter wrote:
> On Wed, Nov 04, 2026 at 02:14:50AM +0000, Wentao Liang wrote:
>> cvm_oct_probe() looks up the device node of every port with
>> cvm_oct_node_for_port(), which walks the children with
>> for_each_child_of_node() and therefore returns the node with an
>> incremented reference count.  The reference is stored in
>> priv->of_node and used for the lifetime of the net_device, but it is
>> never dropped: both probe error paths free the net_device without
>> releasing the node, and cvm_oct_remove_device() does the same on
>> unbind.  Each failed or torn down port therefore keeps its device node
>> referenced forever.
>>
>> Add the missing of_node_put() in the two probe error paths and in
>> cvm_oct_remove_device(), which also covers the error cleanup done after
>> the ports have been registered.  of_node_put() accepts the NULL node of
>> the POW device.
>>
>> Fixes: 422d97b8b05e ("Revert "staging: octeon: delete driver"")
>> Cc: stable@vger.kernel.org
>> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
>> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> 
> Normally with firmware, we just take a reference to the firmware node,
> read the information we need to probe, and then release the reference.
> 
> Is there any need to hold the reference here until basically the system
> shuts down?

Just FYI, you are discussing with a bot. :)

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-04  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  2:14 [PATCH] staging: octeon: release the port device node in cvm_oct_probe Wentao Liang
2026-11-04  7:12 ` Krzysztof Kozlowski
2026-11-04  7:45 ` Dan Carpenter
2026-11-04  8:34   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox