aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-08-25 05:39:34 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:44:21 -0400
commit18c1c3f694105ab2a6f43e054e23f9a751b2f869 (patch)
tree06c01bed5e123f33bbc9633ac6eb98784e626f3b /sound
parent86148e84c218e49b54521e8dae7bb78eb66c4281 (diff)
[ALSA] Return error if no user TLV is defined
Retrun error to user TLV_READ ioctl if no TLV is defined. (Until now, nothing was written and rerunred successfully.) Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/control.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 3030aaa6d2c5..6973a9686b67 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -951,6 +951,8 @@ static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol,
951 ue->tlv_data = new_data; 951 ue->tlv_data = new_data;
952 ue->tlv_data_size = size; 952 ue->tlv_data_size = size;
953 } else { 953 } else {
954 if (! ue->tlv_data_size || ! ue->tlv_data)
955 return -ENXIO;
954 if (size < ue->tlv_data_size) 956 if (size < ue->tlv_data_size)
955 return -ENOSPC; 957 return -ENOSPC;
956 if (copy_to_user(tlv, ue->tlv_data, ue->tlv_data_size)) 958 if (copy_to_user(tlv, ue->tlv_data, ue->tlv_data_size))