b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] pull request for net-next: batman-adv 2024-02-01
@ 2024-02-01 11:07 Simon Wunderlich
  2024-02-01 11:07 ` [PATCH 1/4] batman-adv: Start new development cycle Simon Wunderlich
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:07 UTC (permalink / raw)
  To: kuba, davem; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

Hi Jakub, hi David,

here is a cleanup pull request of batman-adv to go into net-next.

Please pull or let me know of any problem!

Thank you,
      Simon

The following changes since commit 6613476e225e090cc9aad49be7fa504e290dd33d:

  Linux 6.8-rc1 (2024-01-21 14:11:32 -0800)

are available in the Git repository at:

  git://git.open-mesh.org/linux-merge.git tags/batadv-next-pullrequest-20240201

for you to fetch changes up to db60ad8b21cee0394cb0a1092d9f9190d310562c:

  batman-adv: Drop usage of export.h (2024-01-27 09:13:59 +0100)

----------------------------------------------------------------
This cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - Improve error handling in DAT and uevent generator,
   by Markus Elfring (2 patches)

 - Drop usage of export.h, by Sven Eckelmann

----------------------------------------------------------------
Markus Elfring (2):
      batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data()
      batman-adv: Improve exception handling in batadv_throw_uevent()

Simon Wunderlich (1):
      batman-adv: Start new development cycle

Sven Eckelmann (1):
      batman-adv: Drop usage of export.h

 net/batman-adv/distributed-arp-table.c |  3 +--
 net/batman-adv/main.c                  | 14 ++++++++------
 net/batman-adv/main.h                  |  2 +-
 net/batman-adv/netlink.c               |  1 -
 4 files changed, 10 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] batman-adv: Start new development cycle
  2024-02-01 11:07 [PATCH 0/4] pull request for net-next: batman-adv 2024-02-01 Simon Wunderlich
@ 2024-02-01 11:07 ` Simon Wunderlich
  2024-02-02 12:50   ` patchwork-bot+netdevbpf
  2024-02-01 11:07 ` [PATCH 2/4] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data() Simon Wunderlich
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:07 UTC (permalink / raw)
  To: kuba, davem; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

This version will contain all the (major or even only minor) changes for
Linux 6.9.

The version number isn't a semantic version number with major and minor
information. It is just encoding the year of the expected publishing as
Linux -rc1 and the number of published versions this year (starting at 0).

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 870dcd7f1786..8ca854a75a32 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -13,7 +13,7 @@
 #define BATADV_DRIVER_DEVICE "batman-adv"
 
 #ifndef BATADV_SOURCE_VERSION
-#define BATADV_SOURCE_VERSION "2024.0"
+#define BATADV_SOURCE_VERSION "2024.1"
 #endif
 
 /* B.A.T.M.A.N. parameters */
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data()
  2024-02-01 11:07 [PATCH 0/4] pull request for net-next: batman-adv 2024-02-01 Simon Wunderlich
  2024-02-01 11:07 ` [PATCH 1/4] batman-adv: Start new development cycle Simon Wunderlich
@ 2024-02-01 11:07 ` Simon Wunderlich
  2024-02-01 11:07 ` [PATCH 3/4] batman-adv: Improve exception handling in batadv_throw_uevent() Simon Wunderlich
  2024-02-01 11:07 ` [PATCH 4/4] batman-adv: Drop usage of export.h Simon Wunderlich
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:07 UTC (permalink / raw)
  To: kuba, davem
  Cc: netdev, b.a.t.m.a.n, Markus Elfring, Sven Eckelmann, Simon Wunderlich

From: Markus Elfring <elfring@users.sourceforge.net>

The kfree() function was called in one case by
the batadv_dat_forward_data() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

* Thus return directly after a batadv_dat_select_candidates() call failed
  at the beginning.

* Delete the label “out” which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/distributed-arp-table.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 28a939d56090..4c7e85534324 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -684,7 +684,7 @@ static bool batadv_dat_forward_data(struct batadv_priv *bat_priv,
 
 	cand = batadv_dat_select_candidates(bat_priv, ip, vid);
 	if (!cand)
-		goto out;
+		return ret;
 
 	batadv_dbg(BATADV_DBG_DAT, bat_priv, "DHT_SEND for %pI4\n", &ip);
 
@@ -728,7 +728,6 @@ static bool batadv_dat_forward_data(struct batadv_priv *bat_priv,
 		batadv_orig_node_put(cand[i].orig_node);
 	}
 
-out:
 	kfree(cand);
 	return ret;
 }
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] batman-adv: Improve exception handling in batadv_throw_uevent()
  2024-02-01 11:07 [PATCH 0/4] pull request for net-next: batman-adv 2024-02-01 Simon Wunderlich
  2024-02-01 11:07 ` [PATCH 1/4] batman-adv: Start new development cycle Simon Wunderlich
  2024-02-01 11:07 ` [PATCH 2/4] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data() Simon Wunderlich
@ 2024-02-01 11:07 ` Simon Wunderlich
  2024-02-01 11:07 ` [PATCH 4/4] batman-adv: Drop usage of export.h Simon Wunderlich
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:07 UTC (permalink / raw)
  To: kuba, davem
  Cc: netdev, b.a.t.m.a.n, Markus Elfring, Sven Eckelmann, Simon Wunderlich

From: Markus Elfring <elfring@users.sourceforge.net>

The kfree() function was called in up to three cases by
the batadv_throw_uevent() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

* Thus adjust jump targets.

* Reorder kfree() calls at the end.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/main.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 5fc754b0b3f7..75119f1ffccc 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -691,29 +691,31 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
 				  "%s%s", BATADV_UEV_TYPE_VAR,
 				  batadv_uev_type_str[type]);
 	if (!uevent_env[0])
-		goto out;
+		goto report_error;
 
 	uevent_env[1] = kasprintf(GFP_ATOMIC,
 				  "%s%s", BATADV_UEV_ACTION_VAR,
 				  batadv_uev_action_str[action]);
 	if (!uevent_env[1])
-		goto out;
+		goto free_first_env;
 
 	/* If the event is DEL, ignore the data field */
 	if (action != BATADV_UEV_DEL) {
 		uevent_env[2] = kasprintf(GFP_ATOMIC,
 					  "%s%s", BATADV_UEV_DATA_VAR, data);
 		if (!uevent_env[2])
-			goto out;
+			goto free_second_env;
 	}
 
 	ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env);
-out:
-	kfree(uevent_env[0]);
-	kfree(uevent_env[1]);
 	kfree(uevent_env[2]);
+free_second_env:
+	kfree(uevent_env[1]);
+free_first_env:
+	kfree(uevent_env[0]);
 
 	if (ret)
+report_error:
 		batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
 			   "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
 			   batadv_uev_type_str[type],
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] batman-adv: Drop usage of export.h
  2024-02-01 11:07 [PATCH 0/4] pull request for net-next: batman-adv 2024-02-01 Simon Wunderlich
                   ` (2 preceding siblings ...)
  2024-02-01 11:07 ` [PATCH 3/4] batman-adv: Improve exception handling in batadv_throw_uevent() Simon Wunderlich
@ 2024-02-01 11:07 ` Simon Wunderlich
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:07 UTC (permalink / raw)
  To: kuba, davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann, Simon Wunderlich

From: Sven Eckelmann <sven@narfation.org>

The linux/export.h include was introduced in commit 9bcb94c8617e
("batman-adv: Introduce missing headers for genetlink restructure") to have
access to THIS_MODULE. But with commit 5b20755b7780 ("init: move
THIS_MODULE from <linux/export.h> to <linux/init.h>"), it was moved and the
include for export.h is no longer needed.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/netlink.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 1f7ed9d4f6fd..0954757f0b8b 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -15,7 +15,6 @@
 #include <linux/cache.h>
 #include <linux/err.h>
 #include <linux/errno.h>
-#include <linux/export.h>
 #include <linux/genetlink.h>
 #include <linux/gfp.h>
 #include <linux/if_ether.h>
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] batman-adv: Start new development cycle
  2024-02-01 11:07 ` [PATCH 1/4] batman-adv: Start new development cycle Simon Wunderlich
@ 2024-02-02 12:50   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-02 12:50 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: kuba, davem, netdev, b.a.t.m.a.n

Hello:

This series was applied to netdev/net-next.git (main)
by Simon Wunderlich <sw@simonwunderlich.de>:

On Thu,  1 Feb 2024 12:07:53 +0100 you wrote:
> This version will contain all the (major or even only minor) changes for
> Linux 6.9.
> 
> The version number isn't a semantic version number with major and minor
> information. It is just encoding the year of the expected publishing as
> Linux -rc1 and the number of published versions this year (starting at 0).
> 
> [...]

Here is the summary with links:
  - [1/4] batman-adv: Start new development cycle
    https://git.kernel.org/netdev/net-next/c/df3fc228dead
  - [2/4] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data()
    https://git.kernel.org/netdev/net-next/c/ffc15626c861
  - [3/4] batman-adv: Improve exception handling in batadv_throw_uevent()
    https://git.kernel.org/netdev/net-next/c/5593e9abf1cf
  - [4/4] batman-adv: Drop usage of export.h
    https://git.kernel.org/netdev/net-next/c/db60ad8b21ce

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-02 14:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 11:07 [PATCH 0/4] pull request for net-next: batman-adv 2024-02-01 Simon Wunderlich
2024-02-01 11:07 ` [PATCH 1/4] batman-adv: Start new development cycle Simon Wunderlich
2024-02-02 12:50   ` patchwork-bot+netdevbpf
2024-02-01 11:07 ` [PATCH 2/4] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data() Simon Wunderlich
2024-02-01 11:07 ` [PATCH 3/4] batman-adv: Improve exception handling in batadv_throw_uevent() Simon Wunderlich
2024-02-01 11:07 ` [PATCH 4/4] batman-adv: Drop usage of export.h Simon Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).