Skip to content

Commit bd60439

Browse files
Stanimir Varbanovgregkh
authored andcommitted
media: venus: vdec: Init registered list unconditionally
[ Upstream commit bc3d870 ] Presently the list initialization is done only in dynamic-resolution-change state, which leads to list corruptions and use-after-free. Init list_head unconditionally in vdec_stop_capture called by vb2 stop_streaming without takeing into account current codec state. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fa7c336 commit bd60439

File tree

1 file changed

+3
-2
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+3
-2
lines changed

drivers/media/platform/qcom/venus/vdec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,13 +987,14 @@ static int vdec_stop_capture(struct venus_inst *inst)
987987
ret = hfi_session_flush(inst, HFI_FLUSH_OUTPUT);
988988
vdec_cancel_dst_buffers(inst);
989989
inst->codec_state = VENUS_DEC_STATE_CAPTURE_SETUP;
990-
INIT_LIST_HEAD(&inst->registeredbufs);
991990
venus_helper_free_dpb_bufs(inst);
992991
break;
993992
default:
994-
return 0;
993+
break;
995994
}
996995

996+
INIT_LIST_HEAD(&inst->registeredbufs);
997+
997998
return ret;
998999
}
9991000

0 commit comments

Comments
 (0)