]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: dvb-frontends: avoid stack overflow warnings with clang
authorArnd Bergmann <arnd@arndb.de>
Fri, 16 Feb 2024 16:31:44 +0000 (17:31 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:53 +0000 (18:19 -0400)
commit8fad9c5bb00d3a9508d18bbfe832e33a47377730
treee214cb682b00d6d90565430948f7fa2b321185f5
parent8e60b99f6b7ccb3badeb512f5eb613ad45904592
media: dvb-frontends: avoid stack overflow warnings with clang

[ Upstream commit 7a4cf27d1f0538f779bf31b8c99eda394e277119 ]

A previous patch worked around a KASAN issue in stv0367, now a similar
problem showed up with clang:

drivers/media/dvb-frontends/stv0367.c:1222:12: error: stack frame size (3624) exceeds limit (2048) in 'stv0367ter_set_frontend' [-Werror,-Wframe-larger-than]
 1214 | static int stv0367ter_set_frontend(struct dvb_frontend *fe)

Rework the stv0367_writereg() function to be simpler and mark both
register access functions as noinline_for_stack so the temporary
i2c_msg structures do not get duplicated on the stack when KASAN_STACK
is enabled.

Fixes: 3cd890dbe2a4 ("media: dvb-frontends: fix i2c access helpers for KASAN")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/dvb-frontends/stv0367.c