Commit eceb3085 authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

net: bridge: Change a cleanup in br_multicast_new_port_group() to goto

This function is getting more to clean up in the following patches.
Structuring the cleanups in one labeled block will allow reusing the same
cleanup from several places.
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
Acked-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 976b3858
...@@ -1309,8 +1309,7 @@ struct net_bridge_port_group *br_multicast_new_port_group( ...@@ -1309,8 +1309,7 @@ struct net_bridge_port_group *br_multicast_new_port_group(
rhashtable_lookup_insert_fast(&port->br->sg_port_tbl, &p->rhnode, rhashtable_lookup_insert_fast(&port->br->sg_port_tbl, &p->rhnode,
br_sg_port_rht_params)) { br_sg_port_rht_params)) {
NL_SET_ERR_MSG_MOD(extack, "Couldn't insert new port group"); NL_SET_ERR_MSG_MOD(extack, "Couldn't insert new port group");
kfree(p); goto free_out;
return NULL;
} }
rcu_assign_pointer(p->next, next); rcu_assign_pointer(p->next, next);
...@@ -1324,6 +1323,10 @@ struct net_bridge_port_group *br_multicast_new_port_group( ...@@ -1324,6 +1323,10 @@ struct net_bridge_port_group *br_multicast_new_port_group(
eth_broadcast_addr(p->eth_addr); eth_broadcast_addr(p->eth_addr);
return p; return p;
free_out:
kfree(p);
return NULL;
} }
void br_multicast_del_port_group(struct net_bridge_port_group *p) void br_multicast_del_port_group(struct net_bridge_port_group *p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment