]> www.infradead.org Git - users/jedix/linux-maple.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>
Mon, 22 Mar 2021 07:51:50 +0000 (08:51 +0100)
commit0e37b4fa67f55ff4282caebd042a4bfa7348f2a4
tree52634f49cf890a301abeb10b559c806f6cef3921
parent2025a48cfd92d541c5ee47deee97f8a46d00c4ac
media: coda: fix macroblocks count control usage

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>
drivers/media/platform/coda/coda-common.c