kcov: add missing #include <linux/sched.h>
authorKefeng Wang <[email protected]>
Wed, 7 Dec 2016 22:44:36 +0000 (14:44 -0800)
committerLinus Torvalds <[email protected]>
Thu, 8 Dec 2016 01:10:00 +0000 (17:10 -0800)
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]>
kernel/kcov.c

index 30e6d05aa5a9f726422c7968dabbff5e1c590c2a..3cbb0c879705f7a29f1d5bfad58551c098e69432 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/printk.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/vmalloc.h>