[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>
This commit is contained in:
parent
86148e84c2
commit
18c1c3f694
1 changed files with 2 additions and 0 deletions
|
@ -951,6 +951,8 @@ static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol,
|
|||
ue->tlv_data = new_data;
|
||||
ue->tlv_data_size = size;
|
||||
} else {
|
||||
if (! ue->tlv_data_size || ! ue->tlv_data)
|
||||
return -ENXIO;
|
||||
if (size < ue->tlv_data_size)
|
||||
return -ENOSPC;
|
||||
if (copy_to_user(tlv, ue->tlv_data, ue->tlv_data_size))
|
||||
|
|
Loading…
Reference in a new issue