diff options
Diffstat (limited to 'sound/core/control.c')
-rw-r--r-- | sound/core/control.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index d677c27746e9..00fcaa0ca647 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -1099,7 +1099,7 @@ static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol, | |||
1099 | int change = 0; | 1099 | int change = 0; |
1100 | void *new_data; | 1100 | void *new_data; |
1101 | 1101 | ||
1102 | if (op_flag > 0) { | 1102 | if (op_flag == SNDRV_CTL_TLV_OP_WRITE) { |
1103 | if (size > 1024 * 128) /* sane value */ | 1103 | if (size > 1024 * 128) /* sane value */ |
1104 | return -EINVAL; | 1104 | return -EINVAL; |
1105 | 1105 | ||
@@ -1381,9 +1381,12 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file, | |||
1381 | goto __kctl_end; | 1381 | goto __kctl_end; |
1382 | } | 1382 | } |
1383 | vd = &kctl->vd[tlv.numid - kctl->id.numid]; | 1383 | vd = &kctl->vd[tlv.numid - kctl->id.numid]; |
1384 | if ((op_flag == 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) == 0) || | 1384 | if ((op_flag == SNDRV_CTL_TLV_OP_READ && |
1385 | (op_flag > 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) == 0) || | 1385 | (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) == 0) || |
1386 | (op_flag < 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND) == 0)) { | 1386 | (op_flag == SNDRV_CTL_TLV_OP_WRITE && |
1387 | (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) == 0) || | ||
1388 | (op_flag == SNDRV_CTL_TLV_OP_CMD && | ||
1389 | (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND) == 0)) { | ||
1387 | err = -ENXIO; | 1390 | err = -ENXIO; |
1388 | goto __kctl_end; | 1391 | goto __kctl_end; |
1389 | } | 1392 | } |
@@ -1400,7 +1403,7 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file, | |||
1400 | return 0; | 1403 | return 0; |
1401 | } | 1404 | } |
1402 | } else { | 1405 | } else { |
1403 | if (op_flag) { | 1406 | if (op_flag != SNDRV_CTL_ELEM_ACCESS_TLV_READ) { |
1404 | err = -ENXIO; | 1407 | err = -ENXIO; |
1405 | goto __kctl_end; | 1408 | goto __kctl_end; |
1406 | } | 1409 | } |