diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-07 04:20:48 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-18 03:53:59 -0400 |
commit | 77af7575c4b11ce7d27b4cb372abd358b2dcd850 (patch) | |
tree | 7e29c816a445dbce85758313685046edb98844d5 /net/batman-adv/hard-interface.c | |
parent | 00a50076a3afa4014cdd57e87e31a00ce4c4b67e (diff) |
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 fd9715ec6dbd..3b391fd3b5b2 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, | |||
304 | if (!softif_is_valid(soft_iface)) { | 304 | if (!softif_is_valid(soft_iface)) { |
305 | pr_err("Can't create batman mesh interface %s: already exists as regular interface\n", | 305 | pr_err("Can't create batman mesh interface %s: already exists as regular interface\n", |
306 | soft_iface->name); | 306 | soft_iface->name); |
307 | dev_put(soft_iface); | ||
308 | ret = -EINVAL; | 307 | ret = -EINVAL; |
309 | goto err; | 308 | goto err_dev; |
310 | } | 309 | } |
311 | 310 | ||
312 | hard_iface->soft_iface = soft_iface; | 311 | hard_iface->soft_iface = soft_iface; |
313 | bat_priv = netdev_priv(hard_iface->soft_iface); | 312 | bat_priv = netdev_priv(hard_iface->soft_iface); |
314 | 313 | ||
315 | bat_priv->bat_algo_ops->bat_iface_enable(hard_iface); | 314 | ret = bat_priv->bat_algo_ops->bat_iface_enable(hard_iface); |
316 | 315 | if (ret < 0) { | |
317 | if (!hard_iface->packet_buff) { | ||
318 | bat_err(hard_iface->soft_iface, | ||
319 | "Can't add interface packet (%s): out of memory\n", | ||
320 | hard_iface->net_dev->name); | ||
321 | ret = -ENOMEM; | 316 | ret = -ENOMEM; |
322 | goto err; | 317 | goto err_dev; |
323 | } | 318 | } |
324 | 319 | ||
325 | hard_iface->if_num = bat_priv->num_ifaces; | 320 | hard_iface->if_num = bat_priv->num_ifaces; |
@@ -363,6 +358,8 @@ int hardif_enable_interface(struct hard_iface *hard_iface, | |||
363 | out: | 358 | out: |
364 | return 0; | 359 | return 0; |
365 | 360 | ||
361 | err_dev: | ||
362 | dev_put(soft_iface); | ||
366 | err: | 363 | err: |
367 | hardif_free_ref(hard_iface); | 364 | hardif_free_ref(hard_iface); |
368 | return ret; | 365 | return ret; |