diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-27 15:46:54 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 18:15:51 +0200 |
commit | bbed5b89e18148638cdd17fcc2d1d9a7368ddfe6 (patch) | |
tree | 24c3e06612649ac5d582a92062c699e3f17288dc /drivers/staging/media/atomisp/pci/isp | |
parent | 9955d906f28098dfb7be9b5c75006c5f2b431772 (diff) | |
download | linux-bbed5b89e18148638cdd17fcc2d1d9a7368ddfe6.tar.bz2 |
media: atomisp: avoid OOPS due to non-existing ref_frames
stage->args->delay_frames array could point to NULL frames.
What's weird is that we didn't notice this behavior with the
Intel Aero Yocto code.
Handle it, while adding a notice at the code, as this could
be due to some broken pipeline setup.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/isp')
-rw-r--r-- | drivers/staging/media/atomisp/pci/isp/kernels/ref/ref_1.0/ia_css_ref.host.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/ref/ref_1.0/ia_css_ref.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/ref/ref_1.0/ia_css_ref.host.c index 38594741321c..cbe3836419a2 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/ref/ref_1.0/ia_css_ref.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/ref/ref_1.0/ia_css_ref.host.c @@ -29,10 +29,15 @@ ia_css_ref_config( { unsigned int elems_a = ISP_VEC_NELEMS, i; - (void)size; - ia_css_dma_configure_from_info(&to->port_b, &from->ref_frames[0]->info); - to->width_a_over_b = elems_a / to->port_b.elems; - to->dvs_frame_delay = from->dvs_frame_delay; + if (from->ref_frames[0]) { + ia_css_dma_configure_from_info(&to->port_b, &from->ref_frames[0]->info); + to->width_a_over_b = elems_a / to->port_b.elems; + to->dvs_frame_delay = from->dvs_frame_delay; + } else { + to->width_a_over_b = 1; + to->dvs_frame_delay = 0; + to->port_b.elems = elems_a; + } for (i = 0; i < MAX_NUM_VIDEO_DELAY_FRAMES; i++) { if (from->ref_frames[i]) { to->ref_frame_addr_y[i] = from->ref_frames[i]->data + |