drivers: modem: don't clear out cmd handlers if they were not setup
There is no point in clearing out command handlers if they were not setup properly. Just skip to next instruction. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
parent
eae32b7e7a
commit
9fe279f744
1 changed files with 3 additions and 2 deletions
|
@ -497,7 +497,7 @@ static int _modem_cmd_send(struct modem_iface *iface,
|
|||
ret = modem_cmd_handler_update_cmds(data, handler_cmds,
|
||||
handler_cmds_len, true);
|
||||
if (ret < 0) {
|
||||
goto exit;
|
||||
goto unlock_tx_lock;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_MODEM_CONTEXT_VERBOSE_DEBUG)
|
||||
|
@ -531,9 +531,10 @@ static int _modem_cmd_send(struct modem_iface *iface,
|
|||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
/* unset handlers and ignore any errors */
|
||||
(void)modem_cmd_handler_update_cmds(data, NULL, 0U, false);
|
||||
|
||||
unlock_tx_lock:
|
||||
if (!no_tx_lock) {
|
||||
k_sem_give(&data->sem_tx_lock);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue