Skip to content

Commit 166ad0e

Browse files
Kefeng Wangtorvalds
Kefeng Wang
authored andcommitted
kcov: add missing #include <linux/sched.h>
In __sanitizer_cov_trace_pc we use task_struct and fields within it, but as we haven't included <linux/sched.h>, it is not guaranteed to be defined. While we usually happen to acquire the definition through a transitive include, this is fragile (and hasn't been true in the past, causing issues with backports). Include <linux/sched.h> to avoid any fragility. [[email protected]: rewrote changelog] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Kefeng Wang <[email protected]> Acked-by: Mark Rutland <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: James Morse <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 53855d1 commit 166ad0e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/kcov.c

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/fs.h>
88
#include <linux/mm.h>
99
#include <linux/printk.h>
10+
#include <linux/sched.h>
1011
#include <linux/slab.h>
1112
#include <linux/spinlock.h>
1213
#include <linux/vmalloc.h>

0 commit comments

Comments
 (0)