Skip to content

Commit 6a2eefb

Browse files
author
Teppo Järvelin
committed
Cellular: fixed null pointer bug.
Null pointer could have been called after stop() in cellular state machine.
1 parent 15cac12 commit 6a2eefb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

features/cellular/easy_cellular/CellularConnectionFSM.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,7 @@ CellularConnectionFSM::~CellularConnectionFSM()
7676
void CellularConnectionFSM::stop()
7777
{
7878
tr_info("CellularConnectionUtil::stop");
79-
if (_cellularDevice) {
80-
_cellularDevice->close_power();
81-
_cellularDevice->close_network();
82-
_cellularDevice->close_sim();
83-
_power = NULL;
84-
_network = NULL;
85-
_sim = NULL;
86-
}
79+
8780
if (_queue_thread) {
8881
_queue_thread->terminate();
8982
delete _queue_thread;
@@ -162,7 +155,7 @@ bool CellularConnectionFSM::open_sim()
162155
nsapi_error_t err = _sim->set_pin(_sim_pin);
163156
if (err) {
164157
tr_error("SIM pin set failed with: %d, bailing out...", err);
165-
}
158+
}
166159
} else {
167160
tr_warn("PIN required but No SIM pin provided.");
168161
}

0 commit comments

Comments
 (0)