media: atomisp: Remove bogus fh use from atomisp_set_fmt*()
authorHans de Goede <hdegoede@redhat.com>
Mon, 29 May 2023 10:37:31 +0000 (11:37 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:29:19 +0000 (15:29 +0100)
commite79fae3d15095542db18c4cb2adfbd9e8fda91a4
treea977af32d0141a757eb0eb8547b9e0d75eab8cff
parent566f6de6aa283be619e870fae175404b447cdee1
media: atomisp: Remove bogus fh use from atomisp_set_fmt*()

atomisp_set_fmt*() use a local v4l2_subdev_fh declared on the stack,
specifically they use fh.state which is never initialized so when
passing fh.state to atomisp_subdev_set_ffmt() / to
atomisp_subdev_set_selection() these functions are passing random
stack contents as a pointer.

The reason this works is because when the which parameter is
V4L2_SUBDEV_FORMAT_ACTIVE the passed in state is not used.

Remove the bogus fh usage and just pass NULL as state.

Link: https://lore.kernel.org/r/20230529103741.11904-12-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_cmd.c