]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: remove extra NULL checks in snd_pcm_dmix_open()
authorJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 17:37:53 +0000 (19:37 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 17:37:53 +0000 (19:37 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_dmix.c

index 8747450f9f966e395b3a254f7cf5f79071af4d7b..608593f192f9c7387cbadcae732a5429a6f0e163 100644 (file)
@@ -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;
 }