summaryrefslogtreecommitdiff
path: root/net/can/bcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/can/bcm.c')
-rw-r--r--net/can/bcm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/can/bcm.c b/net/can/bcm.c
index c6fee58baac4..3e131dc5f0e5 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -813,6 +813,7 @@ static int bcm_delete_rx_op(struct list_head *ops, canid_t can_id, int ifindex)
bcm_rx_handler, op);
list_del(&op->list);
+ synchronize_rcu();
bcm_remove_op(op);
return 1; /* done */
}
@@ -1538,9 +1539,13 @@ static int bcm_release(struct socket *sock)
REGMASK(op->can_id),
bcm_rx_handler, op);
- bcm_remove_op(op);
}
+ synchronize_rcu();
+
+ list_for_each_entry_safe(op, next, &bo->rx_ops, list)
+ bcm_remove_op(op);
+
/* remove procfs entry */
if (proc_dir && bo->bcm_proc_read)
remove_proc_entry(bo->procname, proc_dir);