From eb95cad4e22a0bf2577f1fa4a3f6fd18caed3362 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 19:37:53 +0200 Subject: [PATCH] pcm: remove extra NULL checks in snd_pcm_dmix_open() Signed-off-by: Jaroslav Kysela --- src/pcm/pcm_dmix.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c index 8747450f..608593f1 100644 --- a/src/pcm/pcm_dmix.c +++ b/src/pcm/pcm_dmix.c @@ -998,7 +998,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *sconf, snd_pcm_stream_t stream, int mode) { - snd_pcm_t *pcm = NULL, *spcm = NULL; + snd_pcm_t *pcm, *spcm = NULL; snd_pcm_direct_t *dmix; int ret, first_instance; @@ -1154,12 +1154,9 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, } else snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); _err_nosem: - if (dmix) { - free(dmix->bindings); - free(dmix); - } - if (pcm) - snd_pcm_free(pcm); + free(dmix->bindings); + free(dmix); + snd_pcm_free(pcm); return ret; } -- 2.11.0