[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ed5weujg.ffs@tglx>
Date: Fri, 06 Sep 2024 16:17:07 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: zhangjiao2 <zhangjiao2@...s.chinamobile.com>, skhan@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
mingo@...hat.com, shuah@...nel.org, zhang jiao
<zhangjiao2@...s.chinamobile.com>
Subject: Re: [PATCH v3] selftests: futex: Fix missing free in main
On Fri, Sep 06 2024 at 10:19, zhangjiao2@...s.chinamobile.com wrote:
> @@ -362,6 +363,7 @@ int main(int argc, char *argv[])
> {
> char *test_name;
> int c, ret;
> + bool is_static = false;
what means is_static? It's not connected to test_name in any way and
please use reverse fir tree variable ordering
https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#variable-declarations
So either use a variable name which makes it clear that it is related to
test_name (something obvious like: name_allocated) or do
char *test_name, *default_name = TEST_NAME;
and do test_name = default_name; in the error path and then check for
(test_name != default_name)
Whatever you pick will be better than the non-obvious is_static.
Thanks,
tglx
Powered by blists - more mailing lists