Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -734,14 +734,23 @@ static struct bcm_op *bcm_find_op(struct list_head *ops,

static void bcm_remove_op(struct bcm_op *op)
{
	if (op->tsklet.func) {
		while (test_bit(TASKLET_STATE_SCHED, &op->tsklet.state) ||
		       test_bit(TASKLET_STATE_RUN, &op->tsklet.state) ||
		       hrtimer_active(&op->timer)) {
			hrtimer_cancel(&op->timer);
	hrtimer_cancel(&op->thrtimer);

	if (op->tsklet.func)
			tasklet_kill(&op->tsklet);
		}
	}

	if (op->thrtsklet.func)
	if (op->thrtsklet.func) {
		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))
		kfree(op->frames);