Skip to content
Commit 5f6b4479 authored by Robert Lubos's avatar Robert Lubos Committed by Fabio Baltieri
Browse files

net: conn: Improve thread safety in connection module



Iterating over connection list w/o mutex lock could lead to a crash on
constant incoming packet flow. Fix this by:

1. Adding mutex lock when iterating over an active connection list, to
   prevent list corruption.
2. Create a copy of the callback and user data pointers before releasing
   lock, to prevent NULL pointer dereference in case connection is
   released before callback is executed.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 4ab2dded
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment