]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ENGR00233780 ASRC: limit output buffer size to avoid kernel dump
authorChen Liangjun <b36089@freescale.com>
Mon, 12 Nov 2012 05:41:13 +0000 (13:41 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:13:26 +0000 (14:13 +0200)
commit55e6092ff51cf58f764f174c9145a08eeccbe04a
treef15d6a7a4ed5e1db676c6da20c61d13e483499cf
parent309dfe85ef64b8b7a41239ac6267103ecc4a99f4
ENGR00233780 ASRC: limit output buffer size to avoid kernel dump

For ASRC memory to memory transfer, user would send driver input buffer
and driver would copy converted output buffer into user's buffer.
However, ASRC can't promise the ratio of output buffer size/input buffer
size being equal to output sample rate/input sample rate.e.g, for
convert from 8k to 48k and 1000 bytes input buffer size, ASRC may pop
out 5999 bytes or 6001 bytes. If driver copy all 6001 bytes into user's
buffer, kernel dump may happens cause of accessing unexisted buffer.

In this patch, if ASRC output buffer size is larger than user's buffer
size, discard exact part.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
drivers/mxc/asrc/mxc_asrc.c