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-02-25 12:35:44 +0000 |
commit | 20b87a34e5ba1a77d361ef147098b69a6508fadf (patch) | |
tree | a247e28e90a0022f496f30629936c2b06695fba7 | |
parent | 5311c7768d06cde23955bbc2aaaa110d698b6510 (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 */ |