summaryrefslogtreecommitdiff
path: root/sound/core/control_led.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-04-01 10:04:31 +0200
committerTakashi Iwai <tiwai@suse.de>2021-04-01 10:04:34 +0200
commit1678320e74d32054942182b19b1e9b42aaba8b29 (patch)
tree50ef9b4c8edef84fb22adeece369c25183301495 /sound/core/control_led.c
parent5b1ed7df01335ecf686edf490948054078d5766d (diff)
parent62327ebbdf0097cda25579522424b350c65422a4 (diff)
Merge branch 'topic/mute-led' into for-next
Pull mute-LED helper fixes from Jaroslav. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/control_led.c')
-rw-r--r--sound/core/control_led.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/core/control_led.c b/sound/core/control_led.c
index d4fb8b873f34..788fd9e275e0 100644
--- a/sound/core/control_led.c
+++ b/sound/core/control_led.c
@@ -506,7 +506,7 @@ static char *parse_iface(char *s, unsigned int *val)
static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, size_t count,
bool attach)
{
- char buf2[256], *s;
+ char buf2[256], *s, *os;
size_t len = max(sizeof(s) - 1, count);
struct snd_ctl_elem_id id;
int err;
@@ -517,6 +517,7 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
s = buf2;
while (*s) {
+ os = s;
if (!strncasecmp(s, "numid=", 6)) {
s = parse_uint(s + 6, &id.numid);
} else if (!strncasecmp(s, "iface=", 6)) {
@@ -546,6 +547,8 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
}
if (*s == ',')
s++;
+ if (s == os)
+ break;
}
err = snd_ctl_led_set_id(led_card->number, &id, led_card->led->group, attach);