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: <20250221165333.2780888-11-raag.jadav@intel.com>
Date: Fri, 21 Feb 2025 22:23:30 +0530
From: Raag Jadav <raag.jadav@...el.com>
To: perex@...ex.cz,
	tiwai@...e.com,
	broonie@...nel.org,
	lgirdwood@...il.com,
	deller@....de,
	andriy.shevchenko@...ux.intel.com,
	sre@...nel.org,
	sakari.ailus@...ux.intel.com,
	mchehab@...nel.org,
	hverkuil-cisco@...all.nl,
	jdmason@...zu.us,
	fancer.lancer@...il.com
Cc: linux-sound@...r.kernel.org,
	linux-fbdev@...r.kernel.org,
	linux-pm@...r.kernel.org,
	linux-media@...r.kernel.org,
	ntb@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Raag Jadav <raag.jadav@...el.com>
Subject: [PATCH v1 10/13] regulator: cros-ec: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@...el.com>
---
 drivers/regulator/cros-ec-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c
index fb9643ed7a49..fb0767b33a36 100644
--- a/drivers/regulator/cros-ec-regulator.c
+++ b/drivers/regulator/cros-ec-regulator.c
@@ -138,8 +138,8 @@ static int cros_ec_regulator_init_info(struct device *dev,
 	data->num_voltages =
 		min_t(u16, ARRAY_SIZE(resp.voltages_mv), resp.num_voltages);
 	data->voltages_mV =
-		devm_kmemdup(dev, resp.voltages_mv,
-			     sizeof(u16) * data->num_voltages, GFP_KERNEL);
+		devm_kmemdup_array(dev, resp.voltages_mv, data->num_voltages,
+				   sizeof(resp.voltages_mv[0]), GFP_KERNEL);
 	if (!data->voltages_mV)
 		return -ENOMEM;
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ