From: Kees Cook <kees@kernel.org>
To: Abhinav Jain <jain.abhinav177@gmail.com>
Cc: tony.luck@intel.com, gpiccoli@igalia.com,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com,
julia.lawall@inria.fr
Subject: Re: [PATCH v2] pstore/ram: Replace of_node_put with __free() for automatic cleanup
Date: Thu, 6 Jun 2024 09:03:28 -0700 [thread overview]
Message-ID: <202406060902.4F06AA0DF6@keescook> (raw)
In-Reply-To: <20240605214944.22113-1-jain.abhinav177@gmail.com>
On Wed, Jun 05, 2024 at 09:49:44PM +0000, Abhinav Jain wrote:
> Add __free(device_node) to the parent_node struct declaration
> Add changes to incorporate the review comments from v1
>
> Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>
>
> PATCH v1 link:
> https://lore.kernel.org/all/20240415161409.8375-1-jain.abhinav177@gmail.com/
>
> Changes since v1:
> - Moved the variable definition back to the top of the function body
The history and version links should be below the "---" line.
But more importantly, please base your patch on the upstream tree,
rather than on your v1 patch. :) (i.e. squash your v1 and v2 together).
-Kees
> ---
> fs/pstore/ram.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index 14f2f4864e48..f8258e4567c3 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -644,6 +644,7 @@ static int ramoops_parse_dt(struct platform_device *pdev,
> struct ramoops_platform_data *pdata)
> {
> struct device_node *of_node = pdev->dev.of_node;
> + struct device_node *parent_node __free(device_node) = of_node_parent(of_node);
> struct resource *res;
> u32 value;
> int ret;
> @@ -703,7 +704,6 @@ static int ramoops_parse_dt(struct platform_device *pdev,
> * we're not a child of "reserved-memory" and mimicking the
> * expected behavior.
> */
> - struct device_node *parent_node __free(device_node) = of_node_parent(of_node);
> if (!of_node_name_eq(parent_node, "reserved-memory") &&
> !pdata->console_size && !pdata->ftrace_size &&
> !pdata->pmsg_size && !pdata->ecc_info.ecc_size) {
> --
> 2.34.1
>
--
Kees Cook
next prev parent reply other threads:[~2024-06-06 16:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 21:49 [PATCH v2] pstore/ram: Replace of_node_put with __free() for automatic cleanup Abhinav Jain
2024-06-06 16:03 ` Kees Cook [this message]
2024-06-09 12:43 ` Abhinav Jain
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=202406060902.4F06AA0DF6@keescook \
--to=kees@kernel.org \
--cc=gpiccoli@igalia.com \
--cc=jain.abhinav177@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=julia.lawall@inria.fr \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tony.luck@intel.com \
/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