ALSA: echoaudio: check kmalloc() result
authorKulikov Vasiliy <segooon@gmail.com>
Fri, 16 Jul 2010 16:15:43 +0000 (20:15 +0400)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Jul 2010 15:59:04 +0000 (17:59 +0200)
If kmalloc() fails exit with -ENOMEM.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Ack-by: Giuliano Pochini <pochini@shiny.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/echoaudio/echoaudio.c

index 668a5ec044992f227f0f7cf37a61325ea5078549..20763dd03fa010f41e6bcd236cb296df02ca8b3b 100644 (file)
@@ -2250,6 +2250,8 @@ static int snd_echo_resume(struct pci_dev *pci)
        DE_INIT(("resume start\n"));
        pci_restore_state(pci);
        commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL);
+       if (commpage_bak == NULL)
+               return -ENOMEM;
        commpage = chip->comm_page;
        memcpy(commpage_bak, commpage, sizeof(struct comm_page));