linux/drivers/media
Arnd Bergmann f410b4093f 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
 be7fd3c3a8 ("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>
2018-03-06 04:59:57 -05:00
..
cec media: cec: improve debugging 2018-02-26 08:12:49 -05:00
common Merge commit 'v4.16-rc4~0' into patchwork 2018-03-05 07:39:06 -05:00
dvb-core media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
dvb-frontends media: lgdt3306a: Fix a double kfree on i2c device remove 2018-03-06 04:40:02 -05:00
firewire vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
i2c Merge commit 'v4.16-rc4~0' into patchwork 2018-03-05 07:39:06 -05:00
mmc media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
pci Merge commit 'v4.16-rc4~0' into patchwork 2018-03-05 07:39:06 -05:00
platform media: stm32-dcmi: add g/s_parm framerate support 2018-02-26 10:30:44 -05:00
radio media: add SPDX license info 2018-02-14 13:17:03 -05:00
rc media: rc: fix race condition in ir_raw_event_store_edge() handling 2018-02-27 08:16:09 -05:00
spi
tuners media: replace all <spaces><tab> occurrences 2018-01-04 13:15:05 -05:00
usb media: em28xx: split up em28xx_dvb_init to reduce stack size 2018-03-06 04:59:57 -05:00
v4l2-core Merge commit 'v4.16-rc4~0' into patchwork 2018-03-05 07:39:06 -05:00
Kconfig media: dvb: fix DVB_MMAP dependency 2018-02-23 05:21:41 -05:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
media-device.c media: zero reservedX fields in media_v2_topology 2018-02-26 09:47:53 -05:00
media-devnode.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
media-entity.c media: media.h: reorganize header to make it easier to understand 2018-02-26 10:14:46 -05:00