media: imx-jpeg: Prevent decoding NV12M jpegs into single-planar buffers
authorMirela Rabulea <mirela.rabulea@oss.nxp.com>
Wed, 12 Jan 2022 19:12:08 +0000 (20:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:59 +0000 (14:23 +0200)
commiteff76b180751e5e55c872d17755680c3b83ba9ab
tree388c0f771a6b1e4b58ecf02f46c15e8f021af156
parent47b45e08e5adb665829979d8a90447e72ab70c2a
media: imx-jpeg: Prevent decoding NV12M jpegs into single-planar buffers

[ Upstream commit 417591a766b3c040c346044541ff949c0b2bb7b2 ]

If the application queues an NV12M jpeg as output buffer, but then
queues a single planar capture buffer, the kernel will crash with
"Unable to handle kernel NULL pointer dereference" in mxc_jpeg_addrs,
prevent this by finishing the job with error.

Signed-off-by: Mirela Rabulea <mirela.rabulea@oss.nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/imx-jpeg/mxc-jpeg.c