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>] [day] [month] [year] [list]
Message-ID: <tencent_5FCF2108621C51007E5526A7C60A5CC1F306@qq.com>
Date: Sun, 18 Jan 2026 17:26:23 +0800
From: Felix Gu <gu_0233@...com>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org, Felix Gu <gu_0233@...com>
Subject: [PATCH] regulator: fp9931: Add missing memory allocation check

Add a check for devm_kzalloc failure in fp9931_probe to prevent a
null pointer dereference.

Fixes: 12d821bd13d4 ("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Felix Gu <gu_0233@...com>
---
 drivers/regulator/fp9931.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c
index 69b3c712e5d5..7fbcc6327cc6 100644
--- a/drivers/regulator/fp9931.c
+++ b/drivers/regulator/fp9931.c
@@ -439,6 +439,9 @@ static int fp9931_probe(struct i2c_client *client)
 	int i;
 
 	data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
 	data->regmap = devm_regmap_init_i2c(client, &regmap_config);
 	if (IS_ERR(data->regmap))
 		return dev_err_probe(&client->dev, PTR_ERR(data->regmap),

---
base-commit: 46fe65a2c28ecf5df1a7475aba1f08ccf4c0ac1b
change-id: 20260118-fp9931-60bbc1e8a351

Best regards,
-- 
Felix Gu <gu_0233@...com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ