diff --git a/security/keys/encrypted_defined.c b/security/keys/encrypted_defined.c
index 0e558dcad92f8edabb57240babf1160a39a7db52..3f4085703e6c7f9c918fcf9129203505e909f71c 100644
--- a/security/keys/encrypted_defined.c
+++ b/security/keys/encrypted_defined.c
@@ -17,6 +17,7 @@
 #include <linux/slab.h>
 #include <linux/parser.h>
 #include <linux/string.h>
+#include <linux/err.h>
 #include <keys/user-type.h>
 #include <keys/trusted-type.h>
 #include <keys/encrypted-type.h>
diff --git a/security/keys/trusted_defined.c b/security/keys/trusted_defined.c
index 1bec72e7596d1dd09d3f9f95875cf7dab57c406f..aaaa069967a6b6287d81c71b1cff5ca2cc4b5788 100644
--- a/security/keys/trusted_defined.c
+++ b/security/keys/trusted_defined.c
@@ -17,6 +17,7 @@
 #include <linux/slab.h>
 #include <linux/parser.h>
 #include <linux/string.h>
+#include <linux/err.h>
 #include <keys/user-type.h>
 #include <keys/trusted-type.h>
 #include <linux/key-type.h>