ASoC: SOF: ipc3-dtrace: Switch to memdup_user_nul() helper
Subsystems (3)
PATCH 1/1 ASoC: SOF: ipc3-dtrace: Switch to memdup_user_nul() helper
Use memdup_user_nul() helper instead of open-coding to simplify the code.
--- sound/soc/sof/ipc3-dtrace.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
sound/soc/sof/ipc3-dtrace.c +3 -9
@@ -196,15 +196,9 @@ static ssize_t dfsentry_trace_filter_write(struct file *file, const char __userreturn -EINVAL ; } - string =kmalloc (count +1 ,GFP_KERNEL ); -if (!string) -return -ENOMEM ; - -if (copy_from_user (string, from, count)) { - ret = -EFAULT ; - goto error; - } - string[count] ='\0' ; + string =memdup_user_nul (from, count); +if (IS_ERR (string)) +return PTR_ERR (string); ret =trace_filter_parse (sdev, string, &num_elems, &elems);if (ret <0 )
Signature · 1 line
2.25.1
Mark Brown
maintainerQuoted 4 lines · Yang Yingliang
Use
memdup_user_nul()helper instead of open-coding to simplify the code.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: ipc3-dtrace: Switch to memdup_user_nul() helper
commit: 93fd2be6eb80fe37570fbd87652ec07a4f7c5b5a
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