[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250204054034.GA1219827@lichtman.org>
Date: Tue, 4 Feb 2025 05:40:34 +0000
From: Nir Lichtman <nir@...htman.org>
To: Doug Anderson <dianders@...omium.org>
Cc: jason.wessel@...driver.com, danielt@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kdb: remove usage of static environment buffer
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@...htman.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
Powered by blists - more mailing lists