ALSA: echoaudio: Fix memory allocation
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 27 Jun 2016 19:06:51 +0000 (21:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 16:47:38 +0000 (09:47 -0700)
commit02a49fd9d0ecc7956cf76b4f7161f2b463e4d73d
tree78ccbe306881b67303f1765b772e90f15d91f1e9
parent0287f6374be41e411db4190e028fc577d338478b
ALSA: echoaudio: Fix memory allocation

commit 9c6795a9b3cbb56a9fbfaf43909c5c22999ba317 upstream.

'commpage_bak' is allocated with 'sizeof(struct echoaudio)' bytes.
We then copy 'sizeof(struct comm_page)' bytes in it.
On my system, smatch complains because one is 2960 and the other is 3072.

This would result in memory corruption or a oops.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/echoaudio/echoaudio.c