The following commit has been merged in the merge/master branch: commit 3f1a86adf26b1d6d1b1f0bbdc74b2a69c9659c61 Author: Antonio Quartulli ordex@autistici.org Date: Wed Apr 25 15:30:13 2012 +0200
batman-adv: use real error codes instead of meaningless -1
Signed-off-by: Antonio Quartulli ordex@autistici.org
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index ab2085c..2a1845e 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -59,7 +59,7 @@ static int bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) { struct batman_ogm_packet *batman_ogm_packet; uint32_t random_seqno; - int res = -1; + int res = -ENOMEM;
/* randomize initial seqno to avoid collision */ get_random_bytes(&random_seqno, sizeof(random_seqno)); diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index e647a43..843caa7 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -309,10 +309,8 @@ int hardif_enable_interface(struct hard_iface *hard_iface, bat_priv = netdev_priv(hard_iface->soft_iface);
ret = bat_priv->bat_algo_ops->bat_iface_enable(hard_iface); - if (ret < 0) { - ret = -ENOMEM; + if (ret < 0) goto err_dev; - }
hard_iface->if_num = bat_priv->num_ifaces; bat_priv->num_ifaces++;