提交 3af37302 编写于 作者: S Stefano Panella 提交者: David Vrabel

uwb: remove beacon cache entry after calling uwb_notify()

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: NStefano Panella <stefano.panella@csr.com>
Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
上级 a01777ec
...@@ -289,8 +289,6 @@ void uwb_beca_purge(struct uwb_rc *rc) ...@@ -289,8 +289,6 @@ void uwb_beca_purge(struct uwb_rc *rc)
expires = bce->ts_jiffies + msecs_to_jiffies(beacon_timeout_ms); expires = bce->ts_jiffies + msecs_to_jiffies(beacon_timeout_ms);
if (time_after(jiffies, expires)) { if (time_after(jiffies, expires)) {
uwbd_dev_offair(bce); uwbd_dev_offair(bce);
list_del(&bce->node);
uwb_bce_put(bce);
} }
} }
mutex_unlock(&rc->uwb_beca.mutex); mutex_unlock(&rc->uwb_beca.mutex);
......
...@@ -375,6 +375,8 @@ int __uwb_dev_offair(struct uwb_dev *uwb_dev, struct uwb_rc *rc) ...@@ -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 ? rc->uwb_dev.dev.parent->bus->name : "n/a",
rc ? dev_name(rc->uwb_dev.dev.parent) : ""); rc ? dev_name(rc->uwb_dev.dev.parent) : "");
uwb_dev_rm(uwb_dev); 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() */ uwb_dev_put(uwb_dev); /* for the creation in _onair() */
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册