From: Nir Lichtman <nir@lichtman.org>
To: Doug Anderson <dianders@chromium.org>
Cc: jason.wessel@windriver.com, danielt@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kdb: remove usage of static environment buffer
Date: Tue, 4 Feb 2025 05:40:34 +0000 [thread overview]
Message-ID: <20250204054034.GA1219827@lichtman.org> (raw)
In-Reply-To: <CAD=FV=WoS+WZ-OX5FnAUuab8re0ovrN9jEm4uADo1XmP5DAGQQ@mail.gmail.com>
On Mon, Feb 03, 2025 at 01:13:31PM -0800, Doug Anderson wrote:
> Hi,
>
> On Mon, Feb 3, 2025 at 12:20 PM Nir Lichtman <nir@lichtman.org> wrote:
> >
> > @@ -348,9 +315,12 @@ static int kdb_setenv(const char *var, const char *val)
> >
[..]
> > + kdb_printf("Could not allocate space for the env var: %s\n",
> > + var);
>
> You don't need the printout. kmalloc is already very shouty if memory
> allocations fail.
>
>
> > + return KDB_KMALLOCFAILED;
[..]
> > + kfree(__env[i]);
>
> I haven't tested it, but shouldn't the above be kfree_const() instead
> of kfree()? Otherwise won't you be trying to kfree() the initial
> strings? ...or am I missing something?
Hi Doug,
Thanks for the review, you're right, my bad, I'll fix to use kfree_const.
Sending shortly a v2 with the fixes.
Nir
>
>
> -Doug
prev parent reply other threads:[~2025-02-04 5:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 20:20 Nir Lichtman
2025-02-03 21:13 ` Doug Anderson
2025-02-04 5:40 ` Nir Lichtman [this message]
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=20250204054034.GA1219827@lichtman.org \
--to=nir@lichtman.org \
--cc=danielt@kernel.org \
--cc=dianders@chromium.org \
--cc=jason.wessel@windriver.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®