diff --git a/security/optee_linuxdriver/armtz/tee_tz_drv.c b/security/optee_linuxdriver/armtz/tee_tz_drv.c index 56386a0521f3..fd6e069c2cb0 100644 --- a/security/optee_linuxdriver/armtz/tee_tz_drv.c +++ b/security/optee_linuxdriver/armtz/tee_tz_drv.c @@ -40,6 +40,10 @@ #include "tee_tz_priv.h" #include "handle.h" +#ifdef CONFIG_ARM +#include +#endif + #ifdef CONFIG_OUTER_CACHE #undef CONFIG_OUTER_CACHE #endif @@ -1431,6 +1435,13 @@ static int __init tee_tz_init(void) { int rc; +#ifdef CONFIG_ARM + if (!psci_smp_available()) { + pr_info("tee: kernel is running in secure mode, tee service unavailable.\n"); + return -EACCES; + } +#endif + pr_info("TEE armv7 Driver initialization\n"); #ifdef _TEE_DEBUG