Skip to content

Commit

Permalink
uwb: remove beacon cache entry after calling uwb_notify()
Browse files Browse the repository at this point in the history
Removing the beacon cache entry from a uwb_dev can cause an oops if the
bce is released before the call to uwb_notify().

Signed-off-by: Stefano Panella <stefano.panella@csr.com>
Signed-off-by: David Vrabel <david.vrabel@csr.com>
  • Loading branch information
Stefano Panella authored and David Vrabel committed Dec 23, 2008
1 parent a01777e commit 3af3730
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/uwb/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ void uwb_beca_purge(struct uwb_rc *rc)
expires = bce->ts_jiffies + msecs_to_jiffies(beacon_timeout_ms);
if (time_after(jiffies, expires)) {
uwbd_dev_offair(bce);
list_del(&bce->node);
uwb_bce_put(bce);
}
}
mutex_unlock(&rc->uwb_beca.mutex);
Expand Down
2 changes: 2 additions & 0 deletions drivers/uwb/lc-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ int __uwb_dev_offair(struct uwb_dev *uwb_dev, struct uwb_rc *rc)
rc ? rc->uwb_dev.dev.parent->bus->name : "n/a",
rc ? dev_name(rc->uwb_dev.dev.parent) : "");
uwb_dev_rm(uwb_dev);
list_del(&uwb_dev->bce->node);
uwb_bce_put(uwb_dev->bce);
uwb_dev_put(uwb_dev); /* for the creation in _onair() */

return 0;
Expand Down

0 comments on commit 3af3730

Please sign in to comment.