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)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 28 Jan 2022 12:18:41 +0000 (13:18 +0100)
commit417591a766b3c040c346044541ff949c0b2bb7b2
tree42def244c7ca377cc381793235201050dc9ab3d4
parenta45bef62022799c2ff4fcbe06da412dc707912ad
media: imx-jpeg: Prevent decoding NV12M jpegs into single-planar buffers

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>
drivers/media/platform/imx-jpeg/mxc-jpeg.c