]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: avoid frame size warning in rtnl_newlink()
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 28 Nov 2018 06:32:31 +0000 (22:32 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Nov 2018 21:33:34 +0000 (13:33 -0800)
commit5fcdee0684bde3bdeecf3923d8c53f21bad66964
treedb2bac40463214bd580b4138924f0e082309383c
parent3c95abb2b9267b16efeae01b46986b9e0482dcfe
rtnetlink: avoid frame size warning in rtnl_newlink()

Standard kernel compilation produces the following warning:

net/core/rtnetlink.c: In function ‘rtnl_newlink’:
net/core/rtnetlink.c:3232:1: warning: the frame size of 1288 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
  ^

This should not really be an issue, as rtnl_newlink() stack is
generally quite shallow.

Fix the warning by allocating attributes with kmalloc() in a wrapper
and passing it down to rtnl_newlink(), avoiding complexities on error
paths.

Alternatively we could kmalloc() some structure within rtnl_newlink(),
slave attributes look like a good candidate.  In practice it adds to
already rather high complexity and length of the function.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c