All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCHv3 maint] batman-adv: protect tt request from double deletion
@ 2015-06-21 16:41 Marek Lindner
  2015-06-22 16:31 ` Antonio Quartulli
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Lindner @ 2015-06-21 16:41 UTC (permalink / raw
  To: b.a.t.m.a.n; +Cc: Marek Lindner

The list_del() calls were changed to list_del_init() to prevent
an accidental double deletion in batadv_tt_req_node_new().

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
v3: rebase on maint & removed hlist conversion
v2: removed redundant hlist_unhashed() check & reword commit message

 translation-table.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index dfe8896..b6c0f52 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -2194,7 +2194,7 @@ static void batadv_tt_req_list_free(struct batadv_priv *bat_priv)
 	spin_lock_bh(&bat_priv->tt.req_list_lock);
 
 	list_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) {
-		list_del(&node->list);
+		list_del_init(&node->list);
 		kfree(node);
 	}
 
@@ -2230,7 +2230,7 @@ static void batadv_tt_req_purge(struct batadv_priv *bat_priv)
 	list_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) {
 		if (batadv_has_timed_out(node->issued_at,
 					 BATADV_TT_REQUEST_TIMEOUT)) {
-			list_del(&node->list);
+			list_del_init(&node->list);
 			kfree(node);
 		}
 	}
@@ -2512,7 +2512,8 @@ out:
 		batadv_hardif_free_ref(primary_if);
 	if (ret && tt_req_node) {
 		spin_lock_bh(&bat_priv->tt.req_list_lock);
-		list_del(&tt_req_node->list);
+		/* list_del_init() verifies tt_req_node still is in the list */
+		list_del_init(&tt_req_node->list);
 		spin_unlock_bh(&bat_priv->tt.req_list_lock);
 		kfree(tt_req_node);
 	}
@@ -2949,7 +2950,7 @@ static void batadv_handle_tt_response(struct batadv_priv *bat_priv,
 	list_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) {
 		if (!batadv_compare_eth(node->addr, resp_src))
 			continue;
-		list_del(&node->list);
+		list_del_init(&node->list);
 		kfree(node);
 	}
 
-- 
2.1.4


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

* Re: [B.A.T.M.A.N.] [PATCHv3 maint] batman-adv: protect tt request from double deletion
  2015-06-21 16:41 [B.A.T.M.A.N.] [PATCHv3 maint] batman-adv: protect tt request from double deletion Marek Lindner
@ 2015-06-22 16:31 ` Antonio Quartulli
  2015-06-24  8:07   ` Marek Lindner
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2015-06-22 16:31 UTC (permalink / raw
  To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Marek Lindner

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]



On 21/06/15 18:41, Marek Lindner wrote:
> The list_del() calls were changed to list_del_init() to prevent
> an accidental double deletion in batadv_tt_req_node_new().
> 
> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>

Acked-by: Antonio Quartulli <antonio@meshcoding.com>


-- 
Antonio Quartulli


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCHv3 maint] batman-adv: protect tt request from double deletion
  2015-06-22 16:31 ` Antonio Quartulli
@ 2015-06-24  8:07   ` Marek Lindner
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Lindner @ 2015-06-24  8:07 UTC (permalink / raw
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

On Monday, June 22, 2015 18:31:39 Antonio Quartulli wrote:
> Signed by antonio@meshcoding.com.	Show Details
> 
> On 21/06/15 18:41, Marek Lindner wrote:
> > The list_del() calls were changed to list_del_init() to prevent
> > an accidental double deletion in batadv_tt_req_node_new().
> >
> > 
> >
> > Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
> 
> Acked-by: Antonio Quartulli <antonio@meshcoding.com>

Applied in revision 9bac35c.

Regards,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-06-24  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-21 16:41 [B.A.T.M.A.N.] [PATCHv3 maint] batman-adv: protect tt request from double deletion Marek Lindner
2015-06-22 16:31 ` Antonio Quartulli
2015-06-24  8:07   ` Marek Lindner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.