Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Staging:B
alsa
0062-pcm-ioplug-extplug-Fix-logic-errors-in-typ...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0062-pcm-ioplug-extplug-Fix-logic-errors-in-type-checks.patch of Package alsa
From fe8bb1fe02f9c7b7cb6048a17a8ff1ea30f97fc8 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <tiwai@suse.de> Date: Tue, 8 Sep 2015 20:57:47 +0200 Subject: [PATCH] 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> --- src/pcm/pcm_extplug.c | 8 ++++---- src/pcm/pcm_ioplug.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pcm/pcm_extplug.c b/src/pcm/pcm_extplug.c index a5de6d848e21..a04f826c90a0 100644 --- a/src/pcm/pcm_extplug.c +++ b/src/pcm/pcm_extplug.c @@ -766,7 +766,7 @@ void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *extplug) int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list) { extplug_priv_t *ext = extplug->pcm->private_data; - if (type < 0 && type >= SND_PCM_EXTPLUG_HW_PARAMS) { + if (type < 0 || type >= SND_PCM_EXTPLUG_HW_PARAMS) { SNDERR("EXTPLUG: invalid parameter type %d", type); return -EINVAL; } @@ -788,7 +788,7 @@ int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, u int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max) { extplug_priv_t *ext = extplug->pcm->private_data; - if (type < 0 && type >= SND_PCM_EXTPLUG_HW_PARAMS) { + if (type < 0 || type >= SND_PCM_EXTPLUG_HW_PARAMS) { SNDERR("EXTPLUG: invalid parameter type %d", type); return -EINVAL; } @@ -814,7 +814,7 @@ int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list) { extplug_priv_t *ext = extplug->pcm->private_data; - if (type < 0 && type >= SND_PCM_EXTPLUG_HW_PARAMS) { + if (type < 0 || type >= SND_PCM_EXTPLUG_HW_PARAMS) { SNDERR("EXTPLUG: invalid parameter type %d", type); return -EINVAL; } @@ -836,7 +836,7 @@ int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigne int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max) { extplug_priv_t *ext = extplug->pcm->private_data; - if (type < 0 && type >= SND_PCM_EXTPLUG_HW_PARAMS) { + if (type < 0 || type >= SND_PCM_EXTPLUG_HW_PARAMS) { SNDERR("EXTPLUG: invalid parameter type %d", type); return -EINVAL; } diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c index fe9347c835d5..43550c03875b 100644 --- a/src/pcm/pcm_ioplug.c +++ b/src/pcm/pcm_ioplug.c @@ -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; } -- 2.5.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor