Linux kernel staging patches
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: octeon: release the port device node in cvm_oct_probe
Date: Wed, 4 Nov 2026 10:45:20 +0300	[thread overview]
Message-ID: <aurikMTyOVMRHDl9@stanley.mountain> (raw)
In-Reply-To: <20261104021450.1468423-1-vulab@iscas.ac.cn>

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


  parent reply	other threads:[~2026-11-04  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-11-04  8:34   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aurikMTyOVMRHDl9@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=vulab@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox