Skip to content
Commit 6aef9d4d authored by Tomi Fontanilles's avatar Tomi Fontanilles Committed by Fabio Baltieri
Browse files

modem: ppp: fix crash when attaching to a pipe



modem_pipe_attach() can send events before returning, which could
provoke a crash as ppp->pipe, still NULL at that time, could be
used either in receiving (if the pipe had some data pending) or
in sending (if the PPP module had already been attached and had
some data to send in its transmit buffer).

ppp->pipe is now set before modem_pipe_attach().
Also, the ATTACHED_BIT is now set only after having actually attached.
And finally, the send_work is now scheduled on PIPE_EVENT_OPENED
so that data is flushed when the (closed) attached pipe is opened.

Signed-off-by: default avatarTomi Fontanilles <tomi.fontanilles@nordicsemi.no>
parent 5fc02e35
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment