OSDN Git Service

media: r820t: fix r820t_write_reg for KASAN
authorArnd Bergmann <arnd@arndb.de>
Thu, 30 Nov 2017 11:08:05 +0000 (06:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Feb 2018 14:43:56 +0000 (15:43 +0100)
commit08e4d04569874f79963a40890e790d2b4c33ed30
tree434a294e4cbdb2db875dd2e29e8a6aaf2a6e51c8
parent30c68fb6582728657000627af186a99280c50721
media: r820t: fix r820t_write_reg for KASAN

commit 16c3ada89cff9a8c2a0eea34ffa1aa20af3f6008 upstream.

With CONFIG_KASAN, we get an overly long stack frame due to inlining
the register access functions:

drivers/media/tuners/r820t.c: In function 'generic_set_freq.isra.7':
drivers/media/tuners/r820t.c:1334:1: error: the frame size of 2880 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

This is caused by a gcc bug that has now been fixed in gcc-8.
To work around the problem, we can pass the register data
through a local variable that older gcc versions can optimize
out as well.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/tuners/r820t.c