ALSA: gus: Delete an error message for a failed memory allocation in snd_gf1_dma_tran...
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 22 Nov 2017 16:43:25 +0000 (17:43 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 29 Nov 2017 08:29:36 +0000 (09:29 +0100)
Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/gus/gus_dma.c

index 36c27c8..7f95f45 100644 (file)
@@ -201,10 +201,9 @@ int snd_gf1_dma_transfer_block(struct snd_gus_card * gus,
        struct snd_gf1_dma_block *block;
 
        block = kmalloc(sizeof(*block), atomic ? GFP_ATOMIC : GFP_KERNEL);
        struct snd_gf1_dma_block *block;
 
        block = kmalloc(sizeof(*block), atomic ? GFP_ATOMIC : GFP_KERNEL);
-       if (block == NULL) {
-               snd_printk(KERN_ERR "gf1: DMA transfer failure; not enough memory\n");
+       if (!block)
                return -ENOMEM;
                return -ENOMEM;
-       }
+
        *block = *__block;
        block->next = NULL;
 
        *block = *__block;
        block->next = NULL;