linux/drivers/media/usb/em28xx
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
..
em28xx-audio.c media: em28xx: calculate left volume level correctly 2017-08-26 14:31:49 -04:00
em28xx-camera.c [media] em28xx: shed some light on video input formats 2017-04-17 17:32:44 -03:00
em28xx-cards.c media: em28xx: adjust I2C timeout according with I2C speed 2018-03-06 04:50:41 -05:00
em28xx-core.c media: em28xx: constify most static structs 2018-03-06 04:49:18 -05:00
em28xx-dvb.c media: em28xx: split up em28xx_dvb_init to reduce stack size 2018-03-06 04:59:57 -05:00
em28xx-i2c.c media: em28xx: adjust I2C timeout according with I2C speed 2018-03-06 04:50:41 -05:00
em28xx-input.c media: em28xx: constify most static structs 2018-03-06 04:49:18 -05:00
em28xx-reg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
em28xx-v4l.h media: au0828/em28xx: make vb2_ops const 2017-10-27 14:13:33 +02:00
em28xx-vbi.c media: au0828/em28xx: make vb2_ops const 2017-10-27 14:13:33 +02:00
em28xx-video.c media: em28xx: stop rewriting device's struct 2018-03-06 04:48:40 -05:00
em28xx.h media: em28xx: adjust I2C timeout according with I2C speed 2018-03-06 04:50:41 -05:00
Kconfig media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
Makefile media: don't include drivers/media/i2c at cflags 2017-12-28 14:14:09 -05:00