VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   30 Branches   50 Tags
author: Sebastian Andrzej Siewior <bigeasy@linutronix.de> 2021-08-30 19:26:26 +0200 committer: Minda Chen <minda.chen@starfivetech.com> 2023-11-06 19:24:39 +0800 commit: de75a0390a219747d04c42f9475e5a0971ef7946 parent: 3305a5e7706cc527f8071fcad8f255ce8c081c42
Commit Summary:
kcov: Avoid enable+disable interrupts if !in_task().
Diffstat:
1 file changed, 3 insertions, 3 deletions
diff --git a/kernel/kcov.c b/kernel/kcov.c
index 4f910231d99a..620dc4ffeb68 100644
--- a/kernel/kcov.c
+++ b/kernel/kcov.c
@@ -869,19 +869,19 @@ void kcov_remote_start(u64 handle)
 		size = CONFIG_KCOV_IRQ_AREA_SIZE;
 		area = this_cpu_ptr(&kcov_percpu_data)->irq_area;
 	}
-	spin_unlock_irqrestore(&kcov_remote_lock, flags);
+	spin_unlock(&kcov_remote_lock);
 
 	/* Can only happen when in_task(). */
 	if (!area) {
+		local_irqrestore(flags);
 		area = vmalloc(size * sizeof(unsigned long));
 		if (!area) {
 			kcov_put(kcov);
 			return;
 		}
+		local_irq_save(flags);
 	}
 
-	local_irq_save(flags);
-
 	/* Reset coverage size. */
 	*(u64 *)area = 0;