Skip to content

Commit

Permalink
ALSA: echoaudio: check kmalloc() result
Browse files Browse the repository at this point in the history
If kmalloc() fails exit with -ENOMEM.

Signed-off-by: Kulikov Vasiliy <[email protected]>
Ack-by: Giuliano Pochini <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
segoon authored and tiwai committed Jul 19, 2010
1 parent 8d011cc commit 0b6d092
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/pci/echoaudio/echoaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 0b6d092

Please sign in to comment.