[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 464109e421d4cef5127c750cb5cdecc9cf83fc92..2195e25087b41fe6546cac7bcdbe2430b8141e35 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 7b1b9f29f3779f3f1b6b32d76f7feb0615e65556..039f27dc1f08e6c01ad07d1e77f61e9d3d95be3b 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;
 }