Re: [PATCH v3] selftests: futex: Fix missing free in main

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 06 2024 at 10:19, zhangjiao2@xxxxxxxxxxxxxxxxxxxx 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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux