提交 0b6d092c 编写于 作者: K Kulikov Vasiliy 提交者: Takashi Iwai

ALSA: echoaudio: check kmalloc() result

If kmalloc() fails exit with -ENOMEM.
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Ack-by: NGiuliano Pochini <pochini@shiny.it>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 8d011cc7
...@@ -2250,6 +2250,8 @@ static int snd_echo_resume(struct pci_dev *pci) ...@@ -2250,6 +2250,8 @@ static int snd_echo_resume(struct pci_dev *pci)
DE_INIT(("resume start\n")); DE_INIT(("resume start\n"));
pci_restore_state(pci); pci_restore_state(pci);
commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL); commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL);
if (commpage_bak == NULL)
return -ENOMEM;
commpage = chip->comm_page; commpage = chip->comm_page;
memcpy(commpage_bak, commpage, sizeof(struct comm_page)); memcpy(commpage_bak, commpage, sizeof(struct comm_page));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册