mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
pcm: ioplug,extplug: Fix logic errors in type checks
A few error checks are wrongly performed with logical and (&&) instead of logical or (||), which condition never met. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
3313f8740d
commit
fe8bb1fe02
2 changed files with 6 additions and 6 deletions
|
|
@ -1019,7 +1019,7 @@ void snd_pcm_ioplug_params_reset(snd_pcm_ioplug_t *ioplug)
|
|||
int snd_pcm_ioplug_set_param_list(snd_pcm_ioplug_t *ioplug, int type, unsigned int num_list, const unsigned int *list)
|
||||
{
|
||||
ioplug_priv_t *io = ioplug->pcm->private_data;
|
||||
if (type < 0 && type >= SND_PCM_IOPLUG_HW_PARAMS) {
|
||||
if (type < 0 || type >= SND_PCM_IOPLUG_HW_PARAMS) {
|
||||
SNDERR("IOPLUG: invalid parameter type %d", type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1043,7 +1043,7 @@ int snd_pcm_ioplug_set_param_list(snd_pcm_ioplug_t *ioplug, int type, unsigned i
|
|||
int snd_pcm_ioplug_set_param_minmax(snd_pcm_ioplug_t *ioplug, int type, unsigned int min, unsigned int max)
|
||||
{
|
||||
ioplug_priv_t *io = ioplug->pcm->private_data;
|
||||
if (type < 0 && type >= SND_PCM_IOPLUG_HW_PARAMS) {
|
||||
if (type < 0 || type >= SND_PCM_IOPLUG_HW_PARAMS) {
|
||||
SNDERR("IOPLUG: invalid parameter type %d", type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue