ALSA: mixart: range checking proc file
commitdb27624dc7355321d86825e29ffcff6c4bc2e87c
authorDan Carpenter <error27@gmail.com>
Tue, 6 Apr 2010 16:31:26 +0000 (6 19:31 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:19 +0000 (26 07:41 -0700)
tree5d2fc04d64d9d174ff79f2faaaa72d6ecfd6f554
parenta54573d774735cc1f9d0e3bbf2c197c2d9523fe8
ALSA: mixart: range checking proc file

commit b0cc58a25d04160d39a80e436847eaa2fbc5aa09 upstream.

The original code doesn't take into consideration that the value of
MIXART_BA0_SIZE - pos can be less than zero which would lead to a large
unsigned value for "count".

Also I moved the check that read size is a multiple of 4 bytes below
the code that adjusts "count".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/pci/mixart/mixart.c