lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87o7nti9zp.fsf@mpe.ellerman.id.au>
Date:   Wed, 12 Apr 2023 22:02:50 +1000
From:   Michael Ellerman <mpe@...erman.id.au>
To:     Deming Wang <wangdeming@...pur.com>, shuah@...nel.org
Cc:     npiggin@...il.com, christophe.leroy@...roup.eu,
        linuxppc-dev@...ts.ozlabs.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org, Deming Wang <wangdeming@...pur.com>
Subject: Re: [PATCH] selftests/powerpc: Replace obsolete memalign() with
 posix_memalign()

Deming Wang <wangdeming@...pur.com> writes:
> memalign() is obsolete according to its manpage.
>
> Replace memalign() with posix_memalign() and remove malloc.h include
> that was there for memalign().
>
> As a pointer is passed into posix_memalign(), initialize *s to NULL
> to silence a warning about the function's return value being used as
> uninitialized (which is not valid anyway because the error is properly
> checked before p is returned).

The patch doesn't do that. There is no p?

I think you've copied the change log for a whole bunch of commits but
not updated them to be accurate for each change?

cheers

> diff --git a/tools/testing/selftests/powerpc/stringloops/strlen.c b/tools/testing/selftests/powerpc/stringloops/strlen.c
> index 9055ebc484d0..f9c1f9cc2d32 100644
> --- a/tools/testing/selftests/powerpc/stringloops/strlen.c
> +++ b/tools/testing/selftests/powerpc/stringloops/strlen.c
> @@ -1,5 +1,4 @@
>  // SPDX-License-Identifier: GPL-2.0
> -#include <malloc.h>
>  #include <stdlib.h>
>  #include <string.h>
>  #include <time.h>
> @@ -51,10 +50,11 @@ static void bench_test(char *s)
>  static int testcase(void)
>  {
>  	char *s;
> +	int ret;
>  	unsigned long i;
>  
> -	s = memalign(128, SIZE);
> -	if (!s) {
> +	ret = posix_memalign((void **)&s, 128, SIZE);
> +	if (ret < 0) {
>  		perror("memalign");
>  		exit(1);
>  	}
> -- 
> 2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ