net: shaper: set ret to -ENOMEM when genlmsg_new() fails in group_doit

genlmsg_new() alloc failure path in net_shaper_nl_group_doit() forgets
to set ret before jumping to error handling.

Fixes: 5d5d4700e7 ("net-shapers: implement NL group operation")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20260510192904.3987113-6-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Jakub Kicinski 2026-05-10 12:28:59 -07:00 committed by Paolo Abeni
parent 6e8ae9d805
commit 8054f85b83

View File

@ -1276,8 +1276,10 @@ int net_shaper_nl_group_doit(struct sk_buff *skb, struct genl_info *info)
* rollback on allocation failure.
*/
msg = genlmsg_new(net_shaper_handle_size(), GFP_KERNEL);
if (!msg)
if (!msg) {
ret = -ENOMEM;
goto free_leaves;
}
hierarchy = net_shaper_hierarchy_setup(binding);
if (!hierarchy) {