diff --git a/net/can/bcm.c b/net/can/bcm.c index d3aac6a2479b5..d3fb1ca6a0e6e 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c @@ -780,6 +780,7 @@ static int bcm_delete_rx_op(struct list_head *ops, struct bcm_msg_head *mh, bcm_rx_handler, op); list_del(&op->list); + synchronize_rcu(); bcm_remove_op(op); return 1; /* done */ } @@ -1505,6 +1506,11 @@ static int bcm_release(struct socket *sock) REGMASK(op->can_id), bcm_rx_handler, op); + } + + synchronize_rcu(); + + list_for_each_entry_safe(op, next, &bo->rx_ops, list) { bcm_remove_op(op); }