ASoC: Intel: avs: Replace risky functions with safer variants
strscpy() and snprintf() are the recommended equivalents of their riskier friends. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240405090929.1184068-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9d2e26f31c
commit
4771484759
@ -535,7 +535,7 @@ int avs_dsp_load_libraries(struct avs_dev *adev, struct avs_tplg_library *libs,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
strncpy(adev->lib_names[id], man->name, AVS_LIB_NAME_SIZE);
|
||||
strscpy(adev->lib_names[id], man->name, AVS_LIB_NAME_SIZE);
|
||||
id++;
|
||||
next_lib:
|
||||
i++;
|
||||
@ -698,7 +698,7 @@ int avs_dsp_first_boot_firmware(struct avs_dev *adev)
|
||||
}
|
||||
|
||||
/* basefw always occupies slot 0 */
|
||||
strcpy(&adev->lib_names[0][0], "BASEFW");
|
||||
strscpy(adev->lib_names[0], "BASEFW", AVS_LIB_NAME_SIZE);
|
||||
|
||||
ida_init(&adev->ppl_ida);
|
||||
|
||||
|
@ -1420,7 +1420,7 @@ static void avs_component_hda_unregister_dais(struct snd_soc_component *componen
|
||||
|
||||
mach = dev_get_platdata(component->card->dev);
|
||||
codec = mach->pdata;
|
||||
sprintf(name, "%s-cpu", dev_name(&codec->core.dev));
|
||||
snprintf(name, sizeof(name), "%s-cpu", dev_name(&codec->core.dev));
|
||||
|
||||
for_each_component_dais_safe(component, dai, save) {
|
||||
int stream;
|
||||
|
Loading…
x
Reference in New Issue
Block a user