author | Song Zhao <song.zhao@amlogic.com> | 2020-02-20 05:43:28 (GMT) |
---|---|---|
committer | Song Zhao <song.zhao@amlogic.com> | 2020-04-03 16:02:21 (GMT) |
commit | 2633a0ab1543f9bd426426d5420580eb9d470406 (patch) | |
tree | 1ee7d3dc046263d900a0569c1d89e5cb884b3de8 | |
parent | 6135de267f282d959db4638242014acc73b30deb (diff) | |
download | media_modules-2633a0ab1543f9bd426426d5420580eb9d470406.zip media_modules-2633a0ab1543f9bd426426d5420580eb9d470406.tar.gz media_modules-2633a0ab1543f9bd426426d5420580eb9d470406.tar.bz2 |
v4l2: fix kernel panic after EOS [1/1]
PD#SWPL-20924
Problem:
After EOS, if there are still frames in dpb, vdec_v4l2_buffer can not be
fetched from vframe. Because rest flow already clear all buffer_specs[].
Solution:
Check for valid v4l_mem_handle
Verify:
U212
Change-Id: I6e22f538bbe01b258acf2b2f6cb5411fdc89e1c4
Signed-off-by: Song Zhao <song.zhao@amlogic.com>
-rw-r--r-- | drivers/amvdec_ports/decoder/vdec_h264_if.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/amvdec_ports/decoder/vdec_h264_if.c b/drivers/amvdec_ports/decoder/vdec_h264_if.c index d8c71ef..04173d6 100644 --- a/drivers/amvdec_ports/decoder/vdec_h264_if.c +++ b/drivers/amvdec_ports/decoder/vdec_h264_if.c @@ -731,8 +731,10 @@ static void vdec_h264_get_vf(struct vdec_h264_inst *inst, struct vdec_v4l2_buffe atomic_set(&vf->use_cnt, 1); fb = (struct vdec_v4l2_buffer *)vf->v4l_mem_handle; - fb->vf_handle = (unsigned long)vf; - fb->status = FB_ST_DISPLAY; + if (fb) { + fb->vf_handle = (unsigned long)vf; + fb->status = FB_ST_DISPLAY; + } *out = fb; |