diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2018-05-08 12:04:07 +0100 |
---|---|---|
committer | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2019-05-01 11:51:33 +0100 |
commit | 1e9864135acd30dad49c3871fbaddf0a0657bc03 (patch) | |
tree | 58bfa5aa0c5aa2cb79a4d1d2102a04feaa4fd3ed | |
parent | 3620a38bde266fea85678441f4052c6b29197b68 (diff) |
staging: media: imx7: fix possible memory corruption in csi
The fifo pixel copy is done based on image parameters, when the bit_pixel is set
we say already that the pixel size is 16bits, so we need to pass the real width
and not a byte per pixel width. This would avoid the copy over the allocated
buffers.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
-rw-r--r-- | drivers/staging/media/imx/imx7-media-csi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 11a1cb1d8a62..3ad5cef722d0 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -525,7 +525,7 @@ static void csi_set_imagpara(struct imx7_csi_dev *csi, int width, int height) int imag_para = 0; unsigned long cr3 = __raw_readl(csi->regbase + CSI_CSICR3); - imag_para = (width << 16) | height; + imag_para = (width / 2 << 16) | height; __raw_writel(imag_para, csi->regbase + CSI_CSIIMAG_PARA); /* reflash the embedded DMA controller */ |