Skip to content
Commit 9ab36968 authored by Jaroslav Kysela's avatar Jaroslav Kysela Committed by Greg Kroah-Hartman
Browse files

ALSA: control-led: use strscpy in set_led_id()

commit 70051cff upstream.

The use of strncpy() in the set_led_id() was incorrect.
The len variable should use 'min(sizeof(buf2) - 1, count)'
expression.

Use strscpy() function to simplify things and handle the error gracefully.

Fixes: a135dfb5

 ("ALSA: led control - add sysfs kcontrol LED marking layer")
Reported-by: default avatar <yang.yang29@zte.com.cn>
Link: https://lore.kernel.org/alsa-devel/202301091945513559977@zte.com.cn/


Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8acfe2c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment