diff mbox series

[1/6,v2] wifi: libertas: add missing calls to cancel_work_sync()

Message ID 20230725060531.72968-1-dmantipov@yandex.ru
State New
Headers show
Series [1/6,v2] wifi: libertas: add missing calls to cancel_work_sync() | expand

Commit Message

Dmitry Antipov July 25, 2023, 6:04 a.m. UTC
Add missing 'cancel_work_sync()' in 'if_sdio_remove()'
and on error handling path in 'if_sdio_probe()'.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/marvell/libertas/if_sdio.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Dan Williams July 31, 2023, 1:25 p.m. UTC | #1
On Tue, 2023-07-25 at 09:04 +0300, Dmitry Antipov wrote:
> Add missing 'cancel_work_sync()' in 'if_sdio_remove()'
> and on error handling path in 'if_sdio_probe()'.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

For the v2 series:

Tested-by: Dan Williams <dcbw@redhat.com>

> ---
>  drivers/net/wireless/marvell/libertas/if_sdio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c
> b/drivers/net/wireless/marvell/libertas/if_sdio.c
> index a63c5e622ee3..a35b33e84670 100644
> --- a/drivers/net/wireless/marvell/libertas/if_sdio.c
> +++ b/drivers/net/wireless/marvell/libertas/if_sdio.c
> @@ -1233,6 +1233,7 @@ static int if_sdio_probe(struct sdio_func
> *func,
>         flush_workqueue(card->workqueue);
>         lbs_remove_card(priv);
>  free:
> +       cancel_work_sync(&card->packet_worker);
>         destroy_workqueue(card->workqueue);
>  err_queue:
>         while (card->packets) {
> @@ -1277,6 +1278,7 @@ static void if_sdio_remove(struct sdio_func
> *func)
>         lbs_stop_card(card->priv);
>         lbs_remove_card(card->priv);
>  
> +       cancel_work_sync(&card->packet_worker);
>         destroy_workqueue(card->workqueue);
>  
>         while (card->packets) {
Kalle Valo Aug. 1, 2023, 2:49 p.m. UTC | #2
Dmitry Antipov <dmantipov@yandex.ru> wrote:

> Add missing 'cancel_work_sync()' in 'if_sdio_remove()'
> and on error handling path in 'if_sdio_probe()'.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> Tested-by: Dan Williams <dcbw@redhat.com>

6 patches applied to wireless-next.git, thanks.

c1861ff1d63d wifi: libertas: add missing calls to cancel_work_sync()
ce44fdf9c9d2 wifi: libertas: use convenient lists to manage SDIO packets
2c531d28f8e9 wifi: libertas: simplify list operations in free_if_spi_card()
6c968e90198f wifi: libertas: cleanup SDIO reset
3e14212f79fd wifi: libertas: handle possible spu_write_u16() errors
f5343efdf5b5 wifi: libertas: prefer kstrtoX() for simple integer conversions
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c
index a63c5e622ee3..a35b33e84670 100644
--- a/drivers/net/wireless/marvell/libertas/if_sdio.c
+++ b/drivers/net/wireless/marvell/libertas/if_sdio.c
@@ -1233,6 +1233,7 @@  static int if_sdio_probe(struct sdio_func *func,
 	flush_workqueue(card->workqueue);
 	lbs_remove_card(priv);
 free:
+	cancel_work_sync(&card->packet_worker);
 	destroy_workqueue(card->workqueue);
 err_queue:
 	while (card->packets) {
@@ -1277,6 +1278,7 @@  static void if_sdio_remove(struct sdio_func *func)
 	lbs_stop_card(card->priv);
 	lbs_remove_card(card->priv);
 
+	cancel_work_sync(&card->packet_worker);
 	destroy_workqueue(card->workqueue);
 
 	while (card->packets) {