Skip to contentSkip to conversation

ALSA: snd_ctl_activate_id(): Fix index look-up

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Nov 7, 2014 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: snd_ctl_activate_id(): Fix index look-up

We want to know the offset for the id that was passed to the function, not the offset of the first id of the control (which is always 0).

---
The function seems currently unused, so no need to add this for stable

---
 sound/core/control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/control.c +1 -1
index 99aa3aa..bb96a46 100644
@@ -572,7 +572,7 @@ int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id,
 		ret = -ENOENT;
 		goto unlock;
 	}
-	index_offset = snd_ctl_get_ioff(kctl, &kctl->id);
+	index_offset = snd_ctl_get_ioff(kctl, id);
 	vd = &kctl->vd[index_offset];
 	ret = 0;
 	if (active) {
Signature · 1 line
1.8.0
Applied
#1 lore raw

At Fri, 7 Nov 2014 14:12:34 +0100,

Quoted 7 lines · Lars-Peter Clausen

We want to know the offset for the id that was passed to the function, not the offset of the first id of the control (which is always 0).

---
The function seems currently unused, so no need to add this for stable

Thanks, applied.

(As I'd like to reduce the amounts post rc4, I put this to for-next
branch, so it'll be merged in 3.19.)

Takashi

Quoted 20 lines
---
 sound/core/control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/control.c +1 -1
index 99aa3aa..bb96a46 100644
@@ -572,7 +572,7 @@ int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id,
 		ret = -ENOENT;
 		goto unlock;
 	}
-	index_offset = snd_ctl_get_ioff(kctl, &kctl->id);
+	index_offset = snd_ctl_get_ioff(kctl, id);
 	vd = &kctl->vd[index_offset];
 	ret = 0;
 	if (active) {
Signature · 1 line
1.8.0