Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a821316 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "neighbour: Prevent Race condition in neighbour subsytem"

parents 708dde5b f583440a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -133,6 +133,9 @@ static void neigh_update_gc_list(struct neighbour *n)
	write_lock_bh(&n->tbl->lock);
	write_lock(&n->lock);

	if (n->dead)
		goto out;

	/* remove from the gc list if new state is permanent or if neighbor
	 * is externally learned; otherwise entry should be on the gc list
	 */
@@ -149,6 +152,7 @@ static void neigh_update_gc_list(struct neighbour *n)
		atomic_inc(&n->tbl->gc_entries);
	}

out:
	write_unlock(&n->lock);
	write_unlock_bh(&n->tbl->lock);
}