]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PM / devfreq: exynos-ppmu: Fix excessive stack usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 22 Oct 2019 14:26:48 +0000 (16:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:38:20 +0000 (08:38 +0100)
commita1651f8355a611d0877a5fe5fd057d6813bf5e67
treeaa80be98f7a16c559d9058b49f71fcc6880df628
parent07a579e07d6d69ff5de51bfb375e58fef1ac7f8b
PM / devfreq: exynos-ppmu: Fix excessive stack usage

[ Upstream commit d4556f5e99d5f603913bac01adaff8670cb2d08b ]

Putting a 'struct devfreq_event_dev' object on the stack is generally
a bad idea and here it leads to a warnig about potential stack overflow:

drivers/devfreq/event/exynos-ppmu.c:643:12: error: stack frame size of 1040 bytes in function 'exynos_ppmu_probe' [-Werror,-Wframe-larger-than=]

There is no real need for the device structure, only the string inside
it, so add an internal helper function that simply takes the string
as its argument and remove the device structure.

Fixes: 1dd62c66d345 ("PM / devfreq: events: extend events by type of counted data")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[cw00.choi: Fix the issue from 'desc->name' to 'desc[j].name']
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/devfreq/event/exynos-ppmu.c