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: <Z0Z3sBZsHz14ceiW@google.com>
Date: Tue, 26 Nov 2024 17:36:48 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Raag Jadav <raag.jadav@...el.com>
Cc: gregkh@...uxfoundation.org, linus.walleij@...aro.org,
	mika.westerberg@...ux.intel.com, andriy.shevchenko@...ux.intel.com,
	broonie@...nel.org, pierre-louis.bossart@...ux.dev,
	linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-input@...r.kernel.org, linux-sound@...r.kernel.org
Subject: Re: [PATCH v2 5/6] input: sparse-keymap: use devm_kmemdup_array()

On Tue, Nov 26, 2024 at 10:52:39PM +0530, Raag Jadav wrote:
> Convert to use devm_kmemdup_array() which is more robust.
> 
> Signed-off-by: Raag Jadav <raag.jadav@...el.com>

Acked-by: Dmitry Torokhov <dmitry.torokhov@...il.com>

> ---
>  drivers/input/sparse-keymap.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
> index 25bf8be6e711..5ec3b9ebcac5 100644
> --- a/drivers/input/sparse-keymap.c
> +++ b/drivers/input/sparse-keymap.c
> @@ -176,8 +176,7 @@ int sparse_keymap_setup(struct input_dev *dev,
>  	for (e = keymap; e->type != KE_END; e++)
>  		map_size++;
>  
> -	map = devm_kmemdup(&dev->dev, keymap, map_size * sizeof(*map),
> -			   GFP_KERNEL);
> +	map = devm_kmemdup_array(&dev->dev, keymap, map_size, sizeof(*map), GFP_KERNEL);
>  	if (!map)
>  		return -ENOMEM;
>  
> -- 
> 2.35.3
> 

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ