Skip to content

Commit 0b6d092

Browse files
segoontiwai
authored andcommitted
ALSA: echoaudio: check kmalloc() result
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>
1 parent 8d011cc commit 0b6d092

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎sound/pci/echoaudio/echoaudio.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,6 +2250,8 @@ static int snd_echo_resume(struct pci_dev *pci)
22502250
DE_INIT(("resume start\n"));
22512251
pci_restore_state(pci);
22522252
commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL);
2253+
if (commpage_bak == NULL)
2254+
return -ENOMEM;
22532255
commpage = chip->comm_page;
22542256
memcpy(commpage_bak, commpage, sizeof(struct comm_page));
22552257

0 commit comments

Comments
 (0)