diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-07 17:20:48 +0800 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-18 09:53:59 +0200 |
commit | 77af7575c4b11ce7d27b4cb372abd358b2dcd850 (patch) | |
tree | 7e29c816a445dbce85758313685046edb98844d5 /net/batman-adv/hard-interface.c | |
parent | 00a50076a3afa4014cdd57e87e31a00ce4c4b67e (diff) | |
download | op-kernel-dev-77af7575c4b11ce7d27b4cb372abd358b2dcd850.zip op-kernel-dev-77af7575c4b11ce7d27b4cb372abd358b2dcd850.tar.gz |
batman-adv: handle routing code initialization properly
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/hard-interface.c')
-rw-r--r-- | net/batman-adv/hard-interface.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index fd9715e..3b391fd 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -304,22 +304,17 @@ int hardif_enable_interface(struct hard_iface *hard_iface, if (!softif_is_valid(soft_iface)) { pr_err("Can't create batman mesh interface %s: already exists as regular interface\n", soft_iface->name); - dev_put(soft_iface); ret = -EINVAL; - goto err; + goto err_dev; } hard_iface->soft_iface = soft_iface; bat_priv = netdev_priv(hard_iface->soft_iface); - bat_priv->bat_algo_ops->bat_iface_enable(hard_iface); - - if (!hard_iface->packet_buff) { - bat_err(hard_iface->soft_iface, - "Can't add interface packet (%s): out of memory\n", - hard_iface->net_dev->name); + ret = bat_priv->bat_algo_ops->bat_iface_enable(hard_iface); + if (ret < 0) { ret = -ENOMEM; - goto err; + goto err_dev; } hard_iface->if_num = bat_priv->num_ifaces; @@ -363,6 +358,8 @@ int hardif_enable_interface(struct hard_iface *hard_iface, out: return 0; +err_dev: + dev_put(soft_iface); err: hardif_free_ref(hard_iface); return ret; |