diff mbox series

[v2,1/2] wifi: ray_cs: remove one redundant del_timer

Message ID 20230316133236.556198-2-dzm91@hust.edu.cn (mailing list archive)
State Accepted
Commit daef020558bc34e8031263aa7cf9e803d709f93a
Delegated to: Kalle Valo
Headers show
Series [v2,1/2] wifi: ray_cs: remove one redundant del_timer | expand

Commit Message

Dongliang Mu March 16, 2023, 1:32 p.m. UTC
In ray_detach, it and its child function ray_release both call
del_timer(_sync) on the same timer.

Fix this by removing the del_timer_sync in the ray_detach, and revising
the del_timer to del_timer_sync.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
---
 drivers/net/wireless/ray_cs.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Kalle Valo May 27, 2023, 8:30 a.m. UTC | #1
Dongliang Mu <dzm91@hust.edu.cn> wrote:

> In ray_detach, it and its child function ray_release both call
> del_timer(_sync) on the same timer.
> 
> Fix this by removing the del_timer_sync in the ray_detach, and revising
> the del_timer to del_timer_sync.
> 
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>

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

daef020558bc wifi: ray_cs: remove one redundant del_timer
072210c725c4 wifi: ray_cs: add sanity check on local->sram/rmem/amem
diff mbox series

Patch

diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 1f57a0055bbd..ce7911137014 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -322,7 +322,6 @@  static int ray_probe(struct pcmcia_device *p_dev)
 static void ray_detach(struct pcmcia_device *link)
 {
 	struct net_device *dev;
-	ray_dev_t *local;
 
 	dev_dbg(&link->dev, "ray_detach\n");
 
@@ -331,9 +330,6 @@  static void ray_detach(struct pcmcia_device *link)
 
 	ray_release(link);
 
-	local = netdev_priv(dev);
-	del_timer_sync(&local->timer);
-
 	if (link->priv) {
 		unregister_netdev(dev);
 		free_netdev(dev);
@@ -734,7 +730,7 @@  static void ray_release(struct pcmcia_device *link)
 
 	dev_dbg(&link->dev, "ray_release\n");
 
-	del_timer(&local->timer);
+	del_timer_sync(&local->timer);
 
 	iounmap(local->sram);
 	iounmap(local->rmem);