drivers: modem: gsm: Cancel the work when stopped

gsm_ppp_stop should cancel possible running work items.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
This commit is contained in:
Yong Cong Sin 2022-01-03 23:52:44 +08:00 committed by Maureen Helm
commit 19910666e0

View file

@ -1051,6 +1051,10 @@ void gsm_ppp_stop(const struct device *dev)
{
struct gsm_modem *gsm = dev->data;
struct net_if *iface = gsm->iface;
struct k_work_sync work_sync;
(void)k_work_cancel_delayable_sync(&gsm->gsm_configure_work, &work_sync);
(void)k_work_cancel_delayable_sync(&gsm->rssi_work_handle, &work_sync);
net_if_l2(iface)->enable(iface, false);