uwb: fix races between events and neh timers

Previous thread: uwb: add pal parameter to new reservation callback by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:02 pm. (1 message)

Next thread: wusb: remove unused #include <version.h> by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:02 pm. (1 message)
From: Linux Kernel Mailing List
Date: Friday, January 2, 2009 - 1:02 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=58be81...
Commit:     58be81ed301d96045bca2b85f3b838910efcfde4
Parent:     307ba6dd73254fe7d2ce27db64ffd90e1bb3c6c0
Author:     David Vrabel &lt;david.vrabel@csr.com&gt;
AuthorDate: Fri Nov 7 18:19:19 2008 +0000
Committer:  David Vrabel &lt;david.vrabel@csr.com&gt;
CommitDate: Fri Nov 7 18:19:19 2008 +0000

    uwb: fix races between events and neh timers
    
    Always use del_timer_sync() before freeing nehs.  Destroy all nehs after
    stopping the radio controller and before cleaning up the reservation
    manager.  Handle the timer running after an event has removed the neh.
    
    This fixes various oopses that may occur if a radio controller is removed
    while a neh timer is still active.
    
    Signed-off-by: David Vrabel &lt;david.vrabel@csr.com&gt;
---
 drivers/uwb/lc-rc.c |    5 +++--
 drivers/uwb/neh.c   |   46 ++++++++++++++++++++++++++++++++--------------
 2 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/drivers/uwb/lc-rc.c b/drivers/uwb/lc-rc.c
index 38e3d57..f00633d 100644
--- a/drivers/uwb/lc-rc.c
+++ b/drivers/uwb/lc-rc.c
@@ -79,7 +79,6 @@ static void uwb_rc_sys_release(struct device *dev)
 	struct uwb_dev *uwb_dev = container_of(dev, struct uwb_dev, dev);
 	struct uwb_rc *rc = container_of(uwb_dev, struct uwb_rc, uwb_dev);
 
-	uwb_rc_neh_destroy(rc);
 	uwb_rc_ie_release(rc);
 	kfree(rc);
 }
@@ -311,7 +310,7 @@ void uwb_rc_rm(struct uwb_rc *rc)
 	rc-&gt;ready = 0;
 
 	uwb_dbg_del_rc(rc);
-	uwb_rsv_cleanup(rc);
+	uwb_rsv_remove_all(rc);
 	uwb_rc_ie_rm(rc, UWB_IDENTIFICATION_IE);
 	if (rc-&gt;beaconing &gt;= 0)
 		uwb_rc_beacon(rc, -1, 0);
@@ -322,6 +321,7 @@ void uwb_rc_rm(struct uwb_rc *rc)
 	rc-&gt;stop(rc);
 
 	uwbd_stop(rc);
+	uwb_rc_neh_destroy(rc);
 
 	uwb_dev_lock(&amp;rc-&gt;uwb_dev);
 	rc-&gt;priv = NULL;
@@ -331,6 +331,7 @@ void uwb_rc_rm(struct uwb_rc *rc)
 	uwb_dev_for_each(rc, uwb_dev_offair_helper, NULL);
 ...
Previous thread: uwb: add pal parameter to new reservation callback by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:02 pm. (1 message)

Next thread: wusb: remove unused #include <version.h> by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:02 pm. (1 message)