Skip to content
Commit 37d39425 authored by Robert Lubos's avatar Robert Lubos Committed by Carles Cufí
Browse files

net: tcp: Fix possible race between TCP work items and context unref



Fix the possible race between TCP work items already scheduled for
execution, and tcp_conn_unref(), by moving the actual TCP context
releasing to the workqueue itself. That way we can be certain, that when
the work items are cancelled, they won't execute. It could be the case,
that the work item was already being processed by the work queue, so
clearing the context could lead to a crash.

Remove the comments around the mutex lock in the work handlers regarding
the race, as it's not the case anymore. I've kept the locks however, as
they do make sense in those places.

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