OSDN Git Service

media: ti-vpe: cal: Restrict DMA to avoid memory corruption
authorNikhil Devshatwar <nikhil.nd@ti.com>
Tue, 12 Nov 2019 14:53:33 +0000 (15:53 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 9 Dec 2019 10:25:19 +0000 (11:25 +0100)
commit6e72eab2e7b7a157d554b8f9faed7676047be7c1
tree65760b93f7a0af5ae06d75dcfb9489a6f777d80c
parent23122c373e33b13001509c5d09620b0ba5f7d08c
media: ti-vpe: cal: Restrict DMA to avoid memory corruption

When setting DMA for video capture from CSI channel, if the DMA size
is not given, it ends up writing as much data as sent by the camera.

This may lead to overwriting the buffers causing memory corruption.
Observed green lines on the default framebuffer.

Restrict the DMA to maximum height as specified in the S_FMT ioctl.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/ti-vpe/cal.c