diff options
author | Arnd Bergmann <arnd@arndb.de> | 2020-05-29 22:00:27 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 19:03:03 +0200 |
commit | 89f3b3196e7fe63a66296c7ed95b96964963c6ea (patch) | |
tree | 8c042b9fa89e3e72e510ec5608d652881e8892e4 /drivers/staging/media/atomisp/pci/isp | |
parent | 5b552b198c2557295becd471bff53bb520fefee5 (diff) | |
download | linux-89f3b3196e7fe63a66296c7ed95b96964963c6ea.tar.bz2 |
media: staging: media: atomisp: fix stack overflow in init_pipe_defaults()
When building with clang, multiple copies of the structures to be
initialized are passed around on the stack and copied locally, using an
insane amount of stack space:
drivers/staging/media/atomisp/pci/sh_css.c:2371:1: error: stack frame size of 26864 bytes in function 'create_pipe' [-Werror,-Wframe-larger-than=]
Use constantly-allocated variables plus an explicit memcpy()
to avoid that.
Co-authored-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fixes: 6dc9a2568f84 ("media: atomisp: convert default struct values to use compound-literals with designated initializers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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/sdis/common/ia_css_sdis_common_types.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/common/ia_css_sdis_common_types.h index c92f5836059b..c2ec30b4abd4 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/common/ia_css_sdis_common_types.h +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/common/ia_css_sdis_common_types.h @@ -197,12 +197,11 @@ struct ia_css_dvs_stat_grid_info { /* DVS statistics generated by accelerator default grid info */ -#define DEFAULT_DVS_GRID_INFO \ -(union ia_css_dvs_grid_u) { \ - .dvs_stat_grid_info = (struct ia_css_dvs_stat_grid_info) { \ +#define DEFAULT_DVS_GRID_INFO { \ + .dvs_stat_grid_info = { \ .fe_roi_cfg = { \ - [1] = (struct dvs_stat_public_dvs_level_fe_roi_cfg) { \ - .x_start = 4 \ + [1] = { \ + .x_start = 4 \ } \ } \ } \ |