Commit 0d29ed28 authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-fixes-for-4.10-20170130' of...

Merge tag 'linux-can-fixes-for-4.10-20170130' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2017-01-30

this is a pull request of one patch.

The patch is by Oliver Hartkopp and fixes the hrtimer/tasklet termination in
bcm op removal.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2b89ed65 a06393ed
...@@ -734,14 +734,23 @@ static struct bcm_op *bcm_find_op(struct list_head *ops, ...@@ -734,14 +734,23 @@ static struct bcm_op *bcm_find_op(struct list_head *ops,
static void bcm_remove_op(struct bcm_op *op) static void bcm_remove_op(struct bcm_op *op)
{ {
hrtimer_cancel(&op->timer); if (op->tsklet.func) {
hrtimer_cancel(&op->thrtimer); while (test_bit(TASKLET_STATE_SCHED, &op->tsklet.state) ||
test_bit(TASKLET_STATE_RUN, &op->tsklet.state) ||
if (op->tsklet.func) hrtimer_active(&op->timer)) {
tasklet_kill(&op->tsklet); hrtimer_cancel(&op->timer);
tasklet_kill(&op->tsklet);
}
}
if (op->thrtsklet.func) if (op->thrtsklet.func) {
tasklet_kill(&op->thrtsklet); while (test_bit(TASKLET_STATE_SCHED, &op->thrtsklet.state) ||
test_bit(TASKLET_STATE_RUN, &op->thrtsklet.state) ||
hrtimer_active(&op->thrtimer)) {
hrtimer_cancel(&op->thrtimer);
tasklet_kill(&op->thrtsklet);
}
}
if ((op->frames) && (op->frames != &op->sframe)) if ((op->frames) && (op->frames != &op->sframe))
kfree(op->frames); kfree(op->frames);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment