* [PATCH] ALSA: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp()
@ 2022-02-25 13:10 Jia-Ju Bai
2022-02-25 17:35 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2022-02-25 13:10 UTC (permalink / raw)
To: oder_chiou, lgirdwood, broonie, perex, tiwai
Cc: alsa-devel, linux-kernel, Jia-Ju Bai
The function devm_kzalloc() in rt5663_parse_dp() can fail, so its return
value should be checked.
Fixes: 457c25efc592 ("ASoC: rt5663: Add the function of impedance sensing")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
sound/soc/codecs/rt5663.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index 2138f62e6af5..3a8fba101b20 100644
--- a/sound/soc/codecs/rt5663.c
+++ b/sound/soc/codecs/rt5663.c
@@ -3478,6 +3478,8 @@ static int rt5663_parse_dp(struct rt5663_priv *rt5663, struct device *dev)
table_size = sizeof(struct impedance_mapping_table) *
rt5663->pdata.impedance_sensing_num;
rt5663->imp_table = devm_kzalloc(dev, table_size, GFP_KERNEL);
+ if (!rt5663->imp_table)
+ return -ENOMEM;
ret = device_property_read_u32_array(dev,
"realtek,impedance_sensing_table",
(u32 *)rt5663->imp_table, table_size);
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp()
2022-02-25 13:10 [PATCH] ALSA: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp() Jia-Ju Bai
@ 2022-02-25 17:35 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-02-25 17:35 UTC (permalink / raw)
To: lgirdwood, perex, tiwai, oder_chiou, Jia-Ju Bai; +Cc: linux-kernel, alsa-devel
On Fri, 25 Feb 2022 05:10:30 -0800, Jia-Ju Bai wrote:
> The function devm_kzalloc() in rt5663_parse_dp() can fail, so its return
> value should be checked.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ALSA: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp()
commit: 4d06f92f38b799295ae22c98be7a20cac3e2a1a7
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-25 17:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 13:10 [PATCH] ALSA: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp() Jia-Ju Bai
2022-02-25 17:35 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®