media: venus: vdec: Init registered list unconditionally
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>
This commit is contained in:
parent
51df3c81ba
commit
bc3d870e41
|
@ -1072,13 +1072,14 @@ static int vdec_stop_capture(struct venus_inst *inst)
|
||||||
case VENUS_DEC_STATE_DRC:
|
case VENUS_DEC_STATE_DRC:
|
||||||
ret = hfi_session_flush(inst, HFI_FLUSH_OUTPUT);
|
ret = hfi_session_flush(inst, HFI_FLUSH_OUTPUT);
|
||||||
inst->codec_state = VENUS_DEC_STATE_CAPTURE_SETUP;
|
inst->codec_state = VENUS_DEC_STATE_CAPTURE_SETUP;
|
||||||
INIT_LIST_HEAD(&inst->registeredbufs);
|
|
||||||
venus_helper_free_dpb_bufs(inst);
|
venus_helper_free_dpb_bufs(inst);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INIT_LIST_HEAD(&inst->registeredbufs);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue