]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: st-delta: avoid excessive stack usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Jun 2025 09:31:56 +0000 (11:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:31 +0000 (11:56 +0200)
commitc7fec6c87a8dccda711b55e4a56597f284a165a9
tree900b6abcf426ece50127d73d24910b8ab41d9c03
parenta0c5aa7b48bcd4cd74f78bba3c08584e4fa32b2b
media: st-delta: avoid excessive stack usage

[ Upstream commit 5954ad7d1af92cb6244c5f31216e43af55febbb7 ]

Building with a reduced stack warning limit shows that delta_mjpeg_decode()
copies a giant structure to the stack each time but only uses three of
its members:

drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c: In function 'delta_mjpeg_decode':
drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c:427:1: error: the frame size of 1296 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]

Open-code the passing of the structure members that are actually used here.

Fixes: 433ff5b4a29b ("[media] st-delta: add mjpeg support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c