diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-12-26 11:41:26 (GMT) |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2015-05-29 08:13:36 (GMT) |
commit | 42d9f2cbd42e1ba137584da8305cf6f68b84f39d (patch) | |
tree | 723fe889f8cd1af2be9572263a463d75ebc98d92 /net/batman-adv/bat_iv_ogm.c | |
parent | 9fc1883ef25a43b895531ac44a38257ba8c2ca62 (diff) | |
download | linux-42d9f2cbd42e1ba137584da8305cf6f68b84f39d.tar.xz |
batman-adv: iv_ogm_iface_enable, direct return values
Directly return error values. No need to use a return variable.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index fc299c0..123aabb 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -308,7 +308,6 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface) struct batadv_ogm_packet *batadv_ogm_packet; unsigned char *ogm_buff; uint32_t random_seqno; - int res = -ENOMEM; /* randomize initial seqno to avoid collision */ get_random_bytes(&random_seqno, sizeof(random_seqno)); @@ -317,7 +316,7 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface) hard_iface->bat_iv.ogm_buff_len = BATADV_OGM_HLEN; ogm_buff = kmalloc(hard_iface->bat_iv.ogm_buff_len, GFP_ATOMIC); if (!ogm_buff) - goto out; + return -ENOMEM; hard_iface->bat_iv.ogm_buff = ogm_buff; @@ -329,10 +328,7 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface) batadv_ogm_packet->reserved = 0; batadv_ogm_packet->tq = BATADV_TQ_MAX_VALUE; - res = 0; - -out: - return res; + return 0; } static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface) |