]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regulator: tps65185: check devm_kzalloc() result in probe
authorYufan Chen <ericterminal@gmail.com>
Sun, 22 Feb 2026 10:40:35 +0000 (18:40 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 23 Feb 2026 14:52:16 +0000 (14:52 +0000)
commit4b73231b2a61c4142a027613d277a19c484dfcc3
treef80fee5f9709195f2a899c4957aa50c7e5652f4c
parentbe704107e79696e855aa41e901a926039b6d2410
regulator: tps65185: check devm_kzalloc() result in probe

tps65185_probe() dereferences the allocation result immediately by using data->regmap. If devm_kzalloc() returns NULL under memory pressure, this leads to a NULL pointer dereference.

Add the missing allocation check and return -ENOMEM on failure.

Signed-off-by: Yufan Chen <ericterminal@gmail.com>
Link: https://patch.msgid.link/20260222104035.90790-1-ericterminal@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/tps65185.c