summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/sysfs.c
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2013-01-12 19:19:06 +0800
committerAntonio Quartulli <ordex@autistici.org>2013-03-13 22:53:47 +0100
commit736292c2e89ff8ba266bdc08ca035f5a7afb68f6 (patch)
treec3015a78a6787d3bd837e732197483d3d32efa19 /net/batman-adv/sysfs.c
parent7f02d1601cf05ce79fde78cb9b9bc2e375f87126 (diff)
downloadlinux-stable-736292c2e89ff8ba266bdc08ca035f5a7afb68f6.tar.gz
linux-stable-736292c2e89ff8ba266bdc08ca035f5a7afb68f6.tar.bz2
linux-stable-736292c2e89ff8ba266bdc08ca035f5a7afb68f6.zip
batman-adv: replace redundant primary_if_get calls
The batadv_priv struct carries a pointer to its own interface struct. Therefore, it is not necessary to retrieve the soft_iface via the primary interface. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
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,
enum batadv_uev_action action, const char *data)
{
int ret = -ENOMEM;
- struct batadv_hard_iface *primary_if;
struct kobject *bat_kobj;
char *uevent_env[4] = { NULL, NULL, NULL, NULL };
- primary_if = batadv_primary_if_get_selected(bat_priv);
- if (!primary_if)
- goto out;
-
- bat_kobj = &primary_if->soft_iface->dev.kobj;
+ bat_kobj = &bat_priv->soft_iface->dev.kobj;
uevent_env[0] = kmalloc(strlen(BATADV_UEV_TYPE_VAR) +
strlen(batadv_uev_type_str[type]) + 1,
@@ -732,9 +727,6 @@ out:
kfree(uevent_env[1]);
kfree(uevent_env[2]);
- if (primary_if)
- batadv_hardif_free_ref(primary_if);
-
if (ret)
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",