media: s5p-mfc: Clear workbit to handle error condition
authorSmitha T Murthy <smitha.t@samsung.com>
Wed, 7 Sep 2022 10:32:26 +0000 (16:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:11:40 +0000 (11:11 +0100)
commitbd1b72f0c39a0d791a087b4e643701a48328ba8e
tree3622c11754b4c9af5560249078c2f69db2269e98
parentbff2698aab6f9b691e1e19adc4ca73e4149c8256
media: s5p-mfc: Clear workbit to handle error condition

commit d3f3c2fe54e30b0636496d842ffbb5ad3a547f9b upstream.

During error on CLOSE_INSTANCE command, ctx_work_bits was not getting
cleared. During consequent mfc execution NULL pointer dereferencing of
this context led to kernel panic. This patch fixes this issue by making
sure to clear ctx_work_bits always.

Fixes: 818cd91ab8c6 ("[media] s5p-mfc: Extract open/close MFC instance commands")
Cc: stable@vger.kernel.org
Cc: linux-fsd@tesla.com
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c