diff options
author | Mark Brown <broonie@kernel.org> | 2023-08-15 19:22:33 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-08-15 19:22:33 +0100 |
commit | a90a7a001624072f47c55716f74c5bc127e17656 (patch) | |
tree | 185638b61051e121a595b5600aa6545145897755 /sound/soc/sof | |
parent | 6e9fd076e72a6c32fe79b1dfcff074823ff1a09a (diff) | |
parent | 29681184da28babc990a66e197d27ab98f2027af (diff) |
Use devm_kmemdup to replace devm_kmalloc + memcpy
Merge series from Li Zetao <lizetao1@huawei.com>:
This patch set use the helper function devm_kmemdup() to replace
devm_kmalloc + memcpy, which is the same as implementing the function
separately.
Diffstat (limited to 'sound/soc/sof')
-rw-r--r-- | sound/soc/sof/ipc3.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/sof/ipc3.c b/sound/soc/sof/ipc3.c index 33df028d4854..fb40378ad084 100644 --- a/sound/soc/sof/ipc3.c +++ b/sound/soc/sof/ipc3.c @@ -567,13 +567,10 @@ int sof_ipc3_get_cc_info(struct snd_sof_dev *sdev, /* create read-only cc_version debugfs to store compiler version info */ /* use local copy of the cc_version to prevent data corruption */ if (sdev->first_boot) { - sdev->cc_version = devm_kmalloc(sdev->dev, cc->ext_hdr.hdr.size, - GFP_KERNEL); - + sdev->cc_version = devm_kmemdup(sdev->dev, cc, cc->ext_hdr.hdr.size, GFP_KERNEL); if (!sdev->cc_version) return -ENOMEM; - memcpy(sdev->cc_version, cc, cc->ext_hdr.hdr.size); ret = snd_sof_debugfs_buf_item(sdev, sdev->cc_version, cc->ext_hdr.hdr.size, "cc_version", 0444); |