[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1576543535.473638193@decadent.org.uk>
Date: Tue, 17 Dec 2019 00:46:34 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Markus Pargmann" <mpa@...gutronix.de>,
"Marek Lindner" <mareklindner@...mailbox.ch>
Subject: [PATCH 3.16 060/136] batman-adv: iv_ogm_iface_enable, direct
return values
3.16.80-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Markus Pargmann <mpa@...gutronix.de>
commit 42d9f2cbd42e1ba137584da8305cf6f68b84f39d upstream.
Directly return error values. No need to use a return variable.
Signed-off-by: Markus Pargmann <mpa@...gutronix.de>
Signed-off-by: Marek Lindner <mareklindner@...mailbox.ch>
[bwh: Backported to 3.16 as dependency of commit 40e220b4218b
"batman-adv: Avoid free/alloc race when handling OGM buffer"]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
net/batman-adv/bat_iv_ogm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -307,7 +307,6 @@ static int batadv_iv_ogm_iface_enable(st
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));
@@ -316,7 +315,7 @@ static int batadv_iv_ogm_iface_enable(st
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;
@@ -328,10 +327,7 @@ static int batadv_iv_ogm_iface_enable(st
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)
Powered by blists - more mailing lists