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

Commit c4d029f2 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

tick/broadcast: Prevent NULL pointer dereference



Dan reported that the recent changes to the broadcast code introduced
a potential NULL dereference.

Add the proper check.

Fixes: e0454311 "tick/broadcast: Sanity check the shutdown of the local clock_event"
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 1f6823fa
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -409,6 +409,7 @@ void tick_broadcast_control(enum tick_broadcast_mode mode)
		break;
	}

	if (bc) {
		if (cpumask_empty(tick_broadcast_mask)) {
			if (!bc_stopped)
				clockevents_shutdown(bc);
@@ -418,6 +419,7 @@ void tick_broadcast_control(enum tick_broadcast_mode mode)
			else
				tick_broadcast_setup_oneshot(bc);
		}
	}
	raw_spin_unlock(&tick_broadcast_lock);
}
EXPORT_SYMBOL_GPL(tick_broadcast_control);