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.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index afbba319d73a..6a44fed12837 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -688,15 +688,10 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
688 enum batadv_uev_action action, const char *data) 688 enum batadv_uev_action action, const char *data)
689{ 689{
690 int ret = -ENOMEM; 690 int ret = -ENOMEM;
691 struct batadv_hard_iface *primary_if;
692 struct kobject *bat_kobj; 691 struct kobject *bat_kobj;
693 char *uevent_env[4] = { NULL, NULL, NULL, NULL }; 692 char *uevent_env[4] = { NULL, NULL, NULL, NULL };
694 693
695 primary_if = batadv_primary_if_get_selected(bat_priv); 694 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 695
701 uevent_env[0] = kmalloc(strlen(BATADV_UEV_TYPE_VAR) + 696 uevent_env[0] = kmalloc(strlen(BATADV_UEV_TYPE_VAR) +
702 strlen(batadv_uev_type_str[type]) + 1, 697 strlen(batadv_uev_type_str[type]) + 1,
@@ -732,9 +727,6 @@ out:
732 kfree(uevent_env[1]); 727 kfree(uevent_env[1]);
733 kfree(uevent_env[2]); 728 kfree(uevent_env[2]);
734 729
735 if (primary_if)
736 batadv_hardif_free_ref(primary_if);
737
738 if (ret) 730 if (ret)
739 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 731 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
740 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", 732 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",