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

Commit 9ea84ad7 authored by Eric Dumazet's avatar Eric Dumazet Committed by Robert Richter
Browse files

oprofile: fix CPU unplug panic in ppro_stop()



If oprofile statically compiled in kernel, a cpu unplug triggers
a panic in ppro_stop(), because a NULL pointer is dereferenced.

Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent 061e41fd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -156,6 +156,8 @@ static void ppro_start(struct op_msrs const * const msrs)
	unsigned int low, high;
	int i;

	if (!reset_value)
		return;
	for (i = 0; i < num_counters; ++i) {
		if (reset_value[i]) {
			CTRL_READ(low, high, msrs, i);
@@ -171,6 +173,8 @@ static void ppro_stop(struct op_msrs const * const msrs)
	unsigned int low, high;
	int i;

	if (!reset_value)
		return;
	for (i = 0; i < num_counters; ++i) {
		if (!reset_value[i])
			continue;