This is a note to let you know that I've just added the patch titled media: s5p-mfc: Clear workbit to handle error condition to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: media-s5p-mfc-clear-workbit-to-handle-error-condition.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d3f3c2fe54e30b0636496d842ffbb5ad3a547f9b Mon Sep 17 00:00:00 2001 From: Smitha T Murthy <smitha.t@xxxxxxxxxxx> Date: Wed, 7 Sep 2022 16:02:26 +0530 Subject: media: s5p-mfc: Clear workbit to handle error condition From: Smitha T Murthy <smitha.t@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxx Cc: linux-fsd@xxxxxxxxx Signed-off-by: Smitha T Murthy <smitha.t@xxxxxxxxxxx> Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c @@ -468,8 +468,10 @@ void s5p_mfc_close_mfc_inst(struct s5p_m s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); /* Wait until instance is returned or timeout occurred */ if (s5p_mfc_wait_for_done_ctx(ctx, - S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0)) + S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0)){ + clear_work_bit_irqsave(ctx); mfc_err("Err returning instance\n"); + } /* Free resources */ s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers, ctx); Patches currently in stable-queue which might be from smitha.t@xxxxxxxxxxx are queue-6.0/media-s5p-mfc-clear-workbit-to-handle-error-condition.patch queue-6.0/media-s5p-mfc-fix-in-register-read-and-write-for-h264.patch queue-6.0/media-s5p-mfc-fix-to-handle-reference-queue-during-finishing.patch