diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-12-11 07:05:02 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-03-06 04:59:57 -0500 |
commit | f410b4093fdd4d8f4644d3d486afe3040eceef7b (patch) | |
tree | c014accd66beade28d0ae75f4e28bcd0bc046c5e /include/media/dvbdev.h | |
parent | cf68c22f106369f6124342c58c4a50f07edd2174 (diff) |
media: em28xx: split up em28xx_dvb_init to reduce stack size
With CONFIG_KASAN, the init function uses a large amount of kernel stack:
drivers/media/usb/em28xx/em28xx-dvb.c: In function 'em28xx_dvb_init.part.4':
drivers/media/usb/em28xx/em28xx-dvb.c:2061:1: error: the frame size of 3232 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
Using gcc-7 with -fsanitize-address-use-after-scope makes this even worse:
drivers/media/usb/em28xx/em28xx-dvb.c: In function 'em28xx_dvb_init':
drivers/media/usb/em28xx/em28xx-dvb.c:2069:1: error: the frame size of 4280 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
By splitting out each part of the switch/case statement that has its own local
variables into a separate function, no single one of them uses more than 500 bytes,
and with a noinline_for_stack annotation we can ensure that they are not merged
back together.
[mchehab@s-opensource.com: fix conflict with changeset
be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner functionality")]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media/dvbdev.h')
0 files changed, 0 insertions, 0 deletions