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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190307141232.GG9224@smile.fi.intel.com>
Date:   Thu, 7 Mar 2019 16:12:32 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux@...musvillemoes.dk
Cc:     Petr Mladek <pmladek@...e.com>
Subject: Re: [PATCH v1] lib/test_printf: Switch to bitmap_zalloc()

+Cc: Petr

On Mon, Mar 04, 2019 at 12:00:09PM +0200, Andy Shevchenko wrote:
> Switch to bitmap_zalloc() to show clearly what we are allocating.
> Besides that it returns pointer of bitmap type instead of opaque void *.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  lib/test_printf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/test_printf.c b/lib/test_printf.c
> index 659b6cc0d483..e8206d8d2d08 100644
> --- a/lib/test_printf.c
> +++ b/lib/test_printf.c
> @@ -481,14 +481,14 @@ static void __init
>  large_bitmap(void)
>  {
>  	const int nbits = 1 << 16;
> -	unsigned long *bits = kcalloc(BITS_TO_LONGS(nbits), sizeof(long), GFP_KERNEL);
> +	unsigned long *bits = bitmap_zalloc(nbits, GFP_KERNEL);
>  	if (!bits)
>  		return;
>  
>  	bitmap_set(bits, 1, 20);
>  	bitmap_set(bits, 60000, 15);
>  	test("1-20,60000-60014", "%*pbl", nbits, bits);
> -	kfree(bits);
> +	bitmap_free(bits);
>  }
>  
>  static void __init
> -- 
> 2.20.1
> 

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ