gprs: Correctly set driver_attached
PATCH 1/1 gprs: Correctly set driver_attached
It seems to me gprs->driver_attached must always be set prior to calling gprs->driver->set_attached(), since if set_attached() fails the callback inverts driver_attached to revert to its prior state.
--- src/gprs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/gprs.c +3 -1
@@ -1593,8 +1593,8 @@ static void gprs_netreg_update(struct ofono_gprs *gprs) gprs->flags |=GPRS_FLAG_ATTACHING ; - gprs->driver->set_attached (gprs, attach, gprs_attach_callback, gprs); gprs->driver_attached = attach; + gprs->driver->set_attached (gprs, attach, gprs_attach_callback, gprs); } static void netreg_status_changed(int status, int lac, int ci, int tech,
@@ -2178,6 +2178,8 @@ void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status) detach: gprs->flags |=GPRS_FLAG_ATTACHING ; + + gprs->driver_attached = FALSE; gprs->driver->set_attached (gprs, FALSE, gprs_attach_callback, gprs); }
Signature · 1 line
1.7.9.5