The following commit has been merged in the next branch: commit a9f3b78bd28a3f876fc5ecbb1e0d65ff965f5f1e Author: Antonio Quartulli ordex@autistici.org Date: Wed Apr 18 09:40:40 2012 +0200
batman-adv: use real error codes instead of meaningless -1
Reported-by: David Miller davem@davemloft.net Signed-off-by: Antonio Quartulli ordex@autistici.org
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index ab2085c..2a1845e 100644 --- a/bat_iv_ogm.c +++ b/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/hard-interface.c b/hard-interface.c index e647a43..843caa7 100644 --- a/hard-interface.c +++ b/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++;