* [PATCH] ASoC: core: Fix Null-point-dereference in fmt_single_name()
@ 2021-05-24 2:49 Kefeng Wang
2021-05-24 11:59 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Kefeng Wang @ 2021-05-24 2:49 UTC (permalink / raw)
To: Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: linux-kernel, alsa-devel, Kefeng Wang, Dmitry Baryshkov, Hulk Robot
Check the return value of devm_kstrdup() in case of
Null-point-dereference.
Fixes: 45dd9943fce0 ("ASoC: core: remove artificial component and DAI name constraint")
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
sound/soc/soc-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 1c0904acb935..a76974ccfce1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2225,6 +2225,8 @@ static char *fmt_single_name(struct device *dev, int *id)
return NULL;
name = devm_kstrdup(dev, devname, GFP_KERNEL);
+ if (!name)
+ return NULL;
/* are we a "%s.%d" name (platform and SPI components) */
found = strstr(name, dev->driver->name);
--
2.26.2
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: core: Fix Null-point-dereference in fmt_single_name()
2021-05-24 2:49 [PATCH] ASoC: core: Fix Null-point-dereference in fmt_single_name() Kefeng Wang
@ 2021-05-24 11:59 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-05-24 11:59 UTC (permalink / raw)
To: Kefeng Wang, Takashi Iwai, Jaroslav Kysela
Cc: Mark Brown, Hulk Robot, linux-kernel, alsa-devel, Dmitry Baryshkov
On Mon, 24 May 2021 10:49:41 +0800, Kefeng Wang wrote:
> Check the return value of devm_kstrdup() in case of
> Null-point-dereference.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: core: Fix Null-point-dereference in fmt_single_name()
commit: 41daf6ba594d55f201c50280ebcd430590441da1
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:[~2021-05-24 12:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 2:49 [PATCH] ASoC: core: Fix Null-point-dereference in fmt_single_name() Kefeng Wang
2021-05-24 11:59 ` 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®