[pulseaudio-discuss] [PATCH] alsa: Remove a redundant check
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Fri Feb 7 07:11:49 PST 2014
On Wed, 2014-01-29 at 20:59 +0200, Tanu Kaskinen wrote:
> If mixer_handle is not NULL, then hctl_handle won't be NULL either.
> The redundant check was confusing, because it looked like we would
> leak the mixer_handle if mixer_handle is non-NULL and hctl_handle is
> NULL.
> ---
> src/modules/alsa/alsa-mixer.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
> index b6e2fd8..3e511a9 100644
> --- a/src/modules/alsa/alsa-mixer.c
> +++ b/src/modules/alsa/alsa-mixer.c
> @@ -3821,8 +3821,8 @@ static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile,
> pa_assert(pcm_handle);
>
> mixer_handle = pa_alsa_open_mixer_for_pcm(pcm_handle, NULL, &hctl_handle);
> - if (!mixer_handle || !hctl_handle) {
> - /* Cannot open mixer, remove all entries */
> + if (!mixer_handle) {
> + /* Cannot open mixer, remove all entries */
> pa_hashmap_remove_all(ps->paths);
> return;
> }
No feedback received. I now pushed this to the "next" branch.
--
Tanu
More information about the pulseaudio-discuss
mailing list