]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pvrusb2: reduce stack usage pvr2_eeprom_analyze()
authorArnd Bergmann <arnd@arndb.de>
Thu, 2 Feb 2017 14:53:04 +0000 (12:53 -0200)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 26 Aug 2017 01:13:56 +0000 (02:13 +0100)
commit14cbc3fb5c624ed33e7ca18267166efa460f124c
tree7435b1f609a8cf0d67adbd0098fac8d087c1da4a
parent93c2d0e614e4a09e88df2c7eb0c03b7214fad94b
pvrusb2: reduce stack usage pvr2_eeprom_analyze()

commit 6830733d53a4517588e56227b9c8538633f0c496 upstream.

The driver uses a relatively large data structure on the stack, which
showed up on my radar as we get a warning with the "latent entropy"
GCC plugin:

drivers/media/usb/pvrusb2/pvrusb2-eeprom.c:153:1: error: the frame size of 1376 bytes is larger than 1152 bytes [-Werror=frame-larger-than=]

The warning is usually hidden as we raise the warning limit to 2048
when the plugin is enabled, but I'd like to lower that again in the
future, and making this function smaller helps to do that without
build regressions.

Further analysis shows that putting an 'i2c_client' structure on
the stack is not really supported, as the embedded 'struct device'
is not initialized here, and we are only saved by the fact that
the function that is called here does not use the pointer at all.

Fixes: d855497edbfb ("V4L/DVB (4228a): pvrusb2 to kernel 2.6.18")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/media/video/pvrusb2/pvrusb2-eeprom.c