Skip to content
Commit 5fab97c9 authored by Martí Bolívar's avatar Martí Bolívar Committed by Jukka Rissanen
Browse files

net/mqtt: fix race condition in mqtt_init()



We need to set the mqtt context recv function prior to calling
net_context_recv which installs the mqtt_recv callback.
If not, we risk a race condition where an unprotected reference
to mqtt->rcv(mqtt, buf) is made in mqtt_recv().

Change-Id: If90ee58f4ea6f7879ef7c12b969ba27647426acc
Signed-off-by: default avatarMarti Bolivar <marti.bolivar@linaro.org>
parent ff3b0190
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment