summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Röjfors <richard@puffinpack.se>2019-09-23 09:15:46 +0200
committerDenis Kenzior <denkenz@gmail.com>2019-09-24 09:55:38 -0500
commit875eb230003145ecc9f71d7352505ac80c566799 (patch)
tree9924fec2278c8a03c8c32f1bbdce8e9a309755fb /src
parentd57900b1cb1d194de4e3b050ce39599da4b9f8b3 (diff)
downloadofono-875eb230003145ecc9f71d7352505ac80c566799.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/gprs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gprs.c b/src/gprs.c
index 6d9b4cd9..8df983a9 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -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);