[ALSA] no need to check pointers passed to vfree() for NULL
authorJesper Juhl <jesper.juhl@gmail.com>
Thu, 9 Feb 2006 19:04:16 +0000 (20:04 +0100)
committerJaroslav Kysela <perex@suse.cz>
Wed, 22 Mar 2006 09:29:21 +0000 (10:29 +0100)
Modules: Digigram VX core,USB generic driver

There's no need to check pointers passed to vfree() for NULL.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/vx/vx_pcm.c
sound/usb/usbaudio.c

index 464109e..2195e25 100644 (file)
@@ -98,10 +98,9 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
 static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs)
 {
        struct snd_pcm_runtime *runtime = subs->runtime;
-       if (runtime->dma_area) {
-               vfree(runtime->dma_area);
-               runtime->dma_area = NULL;
-       }
+
+       vfree(runtime->dma_area);
+       runtime->dma_area = NULL;
        return 0;
 }
 
index 7b1b9f2..039f27d 100644 (file)
@@ -720,10 +720,9 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
 static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs)
 {
        struct snd_pcm_runtime *runtime = subs->runtime;
-       if (runtime->dma_area) {
-               vfree(runtime->dma_area);
-               runtime->dma_area = NULL;
-       }
+
+       vfree(runtime->dma_area);
+       runtime->dma_area = NULL;
        return 0;
 }