media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom()
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 19 Jun 2019 09:21:33 +0000 (05:21 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:38 +0000 (07:28 +0200)
commit5b634140fb4d59a1f2447e6493464596282a413e
tree0b4b4fe924156ea7d64106c84119d349260ec006
parent470a8173293c9bb37eca32e0bb862c0c5acbde7f
media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom()

commit 07d89227a983df957a6a7c56f7c040cde9ac571f upstream.

cfg->type can be overridden by v4l2_ctrl_fill() and the new value is
stored in the local type var. Fix the tests to use this local var.

Fixes: 0996517cf8ea ("V4L/DVB: v4l2: Add new control handling framework")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
[hverkuil-cisco@xs4all.nl: change to !qmenu and !qmenu_int (checkpatch)]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/v4l2-ctrls.c