rtnetlink: Move nesting cancellation rollback to proper function
Subsystems (2)
PATCH v2 1/1 rtnetlink: Move nesting cancellation rollback to proper function
Make rtnl_fill_vf() cancel the vfinfo attribute on error instead of the inner rtnl_fill_vfinfo(), as it is the function that starts it.
---
Changelog -v1->v2: https://lore.kernel.org/all/[email protected]/
* Remove unused vfinfo parameter (Simon)
--- net/core/rtnetlink.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
net/core/rtnetlink.c +4 -5
@@ -1273,7 +1273,6 @@ static noinline_for_stack int rtnl_fill_stats(struct sk_buff *skb, static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,struct net_device *dev,int vfs_num, -struct nlattr *vfinfo,u32 ext_filter_mask) {struct ifla_vf_rss_query_en vf_rss_query_en;
@@ -1343,7 +1342,7 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb, vf_trust.setting = ivi.trusted; vf =nla_nest_start_noflag (skb,IFLA_VF_INFO );if (!vf) - goto nla_put_vfinfo_failure; +return -EMSGSIZE ; if (nla_put(skb, IFLA_VF_MAC, sizeof(vf_mac), &vf_mac) || nla_put(skb, IFLA_VF_BROADCAST, sizeof(vf_broadcast), &vf_broadcast) || nla_put(skb, IFLA_VF_VLAN, sizeof(vf_vlan), &vf_vlan) ||
@@ -1414,8 +1413,6 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb, nla_put_vf_failure:nla_nest_cancel (skb, vf); -nla_put_vfinfo_failure: -nla_nest_cancel (skb, vfinfo);return -EMSGSIZE ; }
@@ -1441,8 +1438,10 @@ static noinline_for_stack int rtnl_fill_vf(struct sk_buff *skb,return -EMSGSIZE ;for (i =0 ; i < num_vfs; i++) { -if (rtnl_fill_vfinfo (skb, dev, i, vfinfo, ext_filter_mask)) +if (rtnl_fill_vfinfo (skb, dev, i, ext_filter_mask)) { +nla_nest_cancel (skb, vfinfo);return -EMSGSIZE ; + } }nla_nest_end (skb, vfinfo);
Signature · 1 line
2.40.1
Paolo Abeni
maintainerHi,
Quoted 4 lines · Gal Pressman
Make
rtnl_fill_vf()cancel the vfinfo attribute on error instead of the innerrtnl_fill_vfinfo(), as it is the function that starts it.Signed-off-by Gal Pressman <[email protected]>
This looks like -net material to me (except for the missing fixes tag). Any special reason to target net-next?
Thanks!
Paolo
Quoted 6 lines · Paolo Abeni
Hi,
Quoted 3 lines · Gal Pressman
Make
rtnl_fill_vf()cancel the vfinfo attribute on error instead of the innerrtnl_fill_vfinfo(), as it is the function that starts it.
Quoted 9 lines
Quoted 1 line
Signed-off-by Gal Pressman <[email protected]>This looks like -net material to me (except for the missing fixes tag). Any special reason to target net-next?
Thanks!
Paolo
Hi Paolo,
This doesn't fix any real bug, it's a cleanup, hence the net-next targeting.
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 10 lines · On Sun, 16 Jul 2023 10:24:40 +0300 you wrote:
Make
rtnl_fill_vf()cancel the vfinfo attribute on error instead of the innerrtnl_fill_vfinfo(), as it is the function that starts it.Signed-off-by Gal Pressman <[email protected]>---
Changelog -v1->v2: https://lore.kernel.org/all/[email protected]/
* Remove unused vfinfo parameter (Simon)[...]
Here is the summary with links:
- [net-next,v2] rtnetlink: Move nesting cancellation rollback to proper function
https://git.kernel.org/netdev/net-next/c/4a59cdfd6699
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html