aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/sysfs.c')
-rw-r--r--net/batman-adv/sysfs.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index afbba319d73a..15a22efa9a67 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -442,6 +442,9 @@ static BATADV_ATTR(gw_bandwidth, S_IRUGO | S_IWUSR, batadv_show_gw_bwidth,
442#ifdef CONFIG_BATMAN_ADV_DEBUG 442#ifdef CONFIG_BATMAN_ADV_DEBUG
443BATADV_ATTR_SIF_UINT(log_level, S_IRUGO | S_IWUSR, 0, BATADV_DBG_ALL, NULL); 443BATADV_ATTR_SIF_UINT(log_level, S_IRUGO | S_IWUSR, 0, BATADV_DBG_ALL, NULL);
444#endif 444#endif
445#ifdef CONFIG_BATMAN_ADV_NC
446BATADV_ATTR_SIF_BOOL(network_coding, S_IRUGO | S_IWUSR, NULL);
447#endif
445 448
446static struct batadv_attribute *batadv_mesh_attrs[] = { 449static struct batadv_attribute *batadv_mesh_attrs[] = {
447 &batadv_attr_aggregated_ogms, 450 &batadv_attr_aggregated_ogms,
@@ -464,6 +467,9 @@ static struct batadv_attribute *batadv_mesh_attrs[] = {
464#ifdef CONFIG_BATMAN_ADV_DEBUG 467#ifdef CONFIG_BATMAN_ADV_DEBUG
465 &batadv_attr_log_level, 468 &batadv_attr_log_level,
466#endif 469#endif
470#ifdef CONFIG_BATMAN_ADV_NC
471 &batadv_attr_network_coding,
472#endif
467 NULL, 473 NULL,
468}; 474};
469 475
@@ -582,13 +588,15 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj,
582 } 588 }
583 589
584 if (status_tmp == BATADV_IF_NOT_IN_USE) { 590 if (status_tmp == BATADV_IF_NOT_IN_USE) {
585 batadv_hardif_disable_interface(hard_iface); 591 batadv_hardif_disable_interface(hard_iface,
592 BATADV_IF_CLEANUP_AUTO);
586 goto unlock; 593 goto unlock;
587 } 594 }
588 595
589 /* if the interface already is in use */ 596 /* if the interface already is in use */
590 if (hard_iface->if_status != BATADV_IF_NOT_IN_USE) 597 if (hard_iface->if_status != BATADV_IF_NOT_IN_USE)
591 batadv_hardif_disable_interface(hard_iface); 598 batadv_hardif_disable_interface(hard_iface,
599 BATADV_IF_CLEANUP_AUTO);
592 600
593 ret = batadv_hardif_enable_interface(hard_iface, buff); 601 ret = batadv_hardif_enable_interface(hard_iface, buff);
594 602
@@ -688,15 +696,10 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
688 enum batadv_uev_action action, const char *data) 696 enum batadv_uev_action action, const char *data)
689{ 697{
690 int ret = -ENOMEM; 698 int ret = -ENOMEM;
691 struct batadv_hard_iface *primary_if;
692 struct kobject *bat_kobj; 699 struct kobject *bat_kobj;
693 char *uevent_env[4] = { NULL, NULL, NULL, NULL }; 700 char *uevent_env[4] = { NULL, NULL, NULL, NULL };
694 701
695 primary_if = batadv_primary_if_get_selected(bat_priv); 702 bat_kobj = &bat_priv->soft_iface->dev.kobj;
696 if (!primary_if)
697 goto out;
698
699 bat_kobj = &primary_if->soft_iface->dev.kobj;
700 703
701 uevent_env[0] = kmalloc(strlen(BATADV_UEV_TYPE_VAR) + 704 uevent_env[0] = kmalloc(strlen(BATADV_UEV_TYPE_VAR) +
702 strlen(batadv_uev_type_str[type]) + 1, 705 strlen(batadv_uev_type_str[type]) + 1,
@@ -732,9 +735,6 @@ out:
732 kfree(uevent_env[1]); 735 kfree(uevent_env[1]);
733 kfree(uevent_env[2]); 736 kfree(uevent_env[2]);
734 737
735 if (primary_if)
736 batadv_hardif_free_ref(primary_if);
737
738 if (ret) 738 if (ret)
739 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 739 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
740 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", 740 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",