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: Stefano Panella <stefano.panella@csr.com>
Signed-off-by: David Vrabel <david.vrabel@csr.com>
diff --git a/drivers/uwb/lc-dev.c b/drivers/uwb/lc-dev.c
index f78087b..e9fe1bb 100644
--- a/drivers/uwb/lc-dev.c
+++ b/drivers/uwb/lc-dev.c
@@ -375,6 +375,8 @@
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;