|
@@ -313,7 +313,13 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
|
|
|
hard_iface->if_num = bat_priv->num_ifaces;
|
|
|
bat_priv->num_ifaces++;
|
|
|
hard_iface->if_status = BATADV_IF_INACTIVE;
|
|
|
- batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces);
|
|
|
+ ret = batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces);
|
|
|
+ if (ret < 0) {
|
|
|
+ bat_priv->bat_algo_ops->bat_iface_disable(hard_iface);
|
|
|
+ bat_priv->num_ifaces--;
|
|
|
+ hard_iface->if_status = BATADV_IF_NOT_IN_USE;
|
|
|
+ goto err_dev;
|
|
|
+ }
|
|
|
|
|
|
hard_iface->batman_adv_ptype.type = ethertype;
|
|
|
hard_iface->batman_adv_ptype.func = batadv_batman_skb_recv;
|