]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 06:37:38 +0000 (08:37 +0200)
commit38dad8fd95b05a5d54553fa3f387ce6d55d402d3
tree27bc288443fe264e7ed31a12c06bb19dc4927fae
parentbec42d1c8fbc732b38e96fe98ab69f536ab8403a
media: coda: fix macroblocks count control usage

commit 0b276e470a4d43e1365d3eb53c608a3d208cabd4 upstream.

Commit b2d3bef1aa78 ("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: b2d3bef1aa78 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/coda/coda-common.c