Skip to content

Commit 6ebc5be

Browse files
Cruz Monrreal IICruz Monrreal II
authored andcommitted
Merge branch 'cellular_fsm' of ssh://github.com/marcemmers/mbed-os into rollup
2 parents 62c0436 + d55f6a9 commit 6ebc5be

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

features/cellular/easy_cellular/CellularConnectionFSM.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ void CellularConnectionFSM::stop()
8484
_queue_thread = NULL;
8585
}
8686

87+
if (_at_queue) {
88+
_at_queue->chain(NULL);
89+
_at_queue = NULL;
90+
}
91+
8792
if (_power) {
8893
_cellularDevice->close_power();
8994
_power = NULL;
@@ -131,6 +136,10 @@ nsapi_error_t CellularConnectionFSM::init()
131136
}
132137

133138
_at_queue = _cellularDevice->get_queue();
139+
if (!_at_queue) {
140+
stop();
141+
return NSAPI_ERROR_NO_MEMORY;
142+
}
134143
_at_queue->chain(&_queue);
135144

136145
_retry_count = 0;

0 commit comments

Comments
 (0)