]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix hclge_dbg_dump_tm_pg() stack usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 Sep 2021 08:58:34 +0000 (10:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Sep 2021 12:31:47 +0000 (13:31 +0100)
commit13c997e3c61e0b800e7c5e9f15d823384129447f
tree83683cac58dbef41736965599acd4fb68bc2d067
parent335ad7eaa3e078e6381177fb0d6acfb9854b2821
net: hns3: fix hclge_dbg_dump_tm_pg() stack usage

This function copies strings around between multiple buffers
including a large on-stack array that causes a build warning
on 32-bit systems:

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c: In function 'hclge_dbg_dump_tm_pg':
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:782:1: error: the frame size of 1424 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]

The function can probably be cleaned up a lot, to go back to
printing directly into the output buffer, but dynamically allocating
the structure is a simpler workaround for now.

Fixes: 94c57bd079ea ("net: hns3: refine function hclge_dbg_dump_tm_pri()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c