ALSA: ctl: allow TLV read operation for callback type of element in locked case
[platform/kernel/linux-rpi.git] / sound / core / control.c
index 3fa1171..4728f68 100644 (file)
@@ -1398,8 +1398,9 @@ static int call_tlv_handler(struct snd_ctl_file *file, int op_flag,
        if (kctl->tlv.c == NULL)
                return -ENXIO;
 
-       /* When locked, this is unavailable. */
-       if (vd->owner != NULL && vd->owner != file)
+       /* Write and command operations are not allowed for locked element. */
+       if (op_flag != SNDRV_CTL_TLV_OP_READ &&
+           vd->owner != NULL && vd->owner != file)
                return -EPERM;
 
        return kctl->tlv.c(kctl, op_flag, size, buf);