gprs: Do nothing on detached when attaching.

Its incorrect to fiddle with the driver attach state when
attaching. When attaching the state is transitioning,
and the correct state will now always be assigned in
the end of the attach process, regardless of result.
This commit is contained in:
Richard Röjfors 2019-09-23 09:15:46 +02:00 committed by Denis Kenzior
parent d57900b1cb
commit 875eb23000
1 changed files with 9 additions and 0 deletions

View File

@ -2576,6 +2576,15 @@ void ofono_gprs_detached_notify(struct ofono_gprs *gprs)
{
DBG("%s", __ofono_atom_get_path(gprs->atom));
/*
* In case we are attaching let that finish, it will update to the
* correct status. If we fiddle with driver_attach and the
* attach fails, the code will invert back the state to attached,
* which would leave us in an incorrect state.
*/
if (gprs->flags & GPRS_FLAG_ATTACHING)
return;
gprs->driver_attached = FALSE;
gprs_attached_update(gprs);