]> git.baikalelectronics.ru Git - kernel.git/commit
media: coda: fix macroblocks count control usage
authorMarco Felsch <m.felsch@pengutronix.de>
Fri, 5 Mar 2021 08:23:54 +0000 (09:23 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 15 Apr 2021 11:23:26 +0000 (13:23 +0200)
commitb961fde1a81b9e56900e4a168168820bb1cb6e82
tree4ccac562768bca7cc0ccc9ad63a995f202f7f134
parent2645fb3ea04c177ddf272f8d7e507391e3a74185
media: coda: fix macroblocks count control usage

Commit d3644a0bb0dd ("media: coda: Add a V4L2 user for control error
macroblocks count") add the control for the decoder devices. But
during streamon() this ioctl gets called for all (encoder and decoder)
devices and on encoder devices this causes a null pointer exception.

Fix this by setting the control only if it is really accessible.

Fixes: d3644a0bb0dd ("media: coda: Add a V4L2 user for control error macroblocks count")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Cc: <stable@vger.kernel.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/coda/coda-common.c