]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: ctl: confirm to return all identical information in 'activate' event
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 11 Apr 2015 08:41:02 +0000 (17:41 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sat, 11 Apr 2015 15:31:31 +0000 (17:31 +0200)
When event originator doesn't set numerical ID in identical information,
the event data includes no numerical ID, thus userspace applications
cannot identify the control just by unique ID in event data.

This commit fix this bug so as the event data includes all of identical
information.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control.c

index 00fcaa0ca647e3b33e136ce17b8df08e7443db9c..90a9e5d9819af8aa76c5faf5fb5afe96b6283b45 100644 (file)
@@ -578,6 +578,7 @@ static int snd_ctl_remove_user_ctl(struct snd_ctl_file * file,
  *
  * Finds the control instance with the given id, and activate or
  * inactivate the control together with notification, if changed.
+ * The given ID data is filled with full information.
  *
  * Return: 0 if unchanged, 1 if changed, or a negative error code on failure.
  */
@@ -607,6 +608,7 @@ int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id,
                        goto unlock;
                vd->access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
        }
+       snd_ctl_build_ioff(id, kctl, index_offset);
        ret = 1;
  unlock:
        up_write(&card->controls_rwsem);