shell: telnet: Make sure the delayed work becomes idle after canceling

Replace k_work_cancel_delayable() with k_work_cancel_delayable_sync()
to make sure that the submitted work becomes idle before accessing
sensitive data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2021-04-08 16:33:47 +02:00 committed by Anas Nashif
commit 1a69317eea
2 changed files with 9 additions and 4 deletions

View file

@ -46,6 +46,7 @@ struct shell_telnet {
* to send the shell prompt for instance.
*/
struct k_work_delayable send_work;
struct k_work_sync work_sync;
/** If set, no output is sent to the TELNET client. */
bool output_lock;