tee: fix compiler warning in tee_shm_register()
PATCH 1/1 tee: fix compiler warning in tee_shm_register()
Include <linux/uaccess.h> to avoid the warning:
drivers/tee/tee_shm.c: In function 'tee_shm_register':
Quoted 1 line
Quoted 1 line
drivers/tee/tee_shm.c:242:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]
242 | if (!access_ok((void __user *)addr, length))
| ^~~~~~~~~cc1: some warnings being treated as errors
--- drivers/tee/tee_shm.c | 1 + 1 file changed, 1 insertion(+)
drivers/tee/tee_shm.c +1 -0
@@ -9,6 +9,7 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/tee_drv.h> +#include <linux/uaccess.h> #include <linux/uio.h> #include "tee_private.h"
Signature · 1 line
2.31.1
Quoted 6 lines · Jens Wiklander
Include <
linux/uaccess.h> to avoid the warning:
drivers/tee/tee_shm.c: In function 'tee_shm_register':Quoted 1 line
Quoted 1 line
drivers/tee/tee_shm.c:242:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]242 | if (!access_ok((void __user *)addr, length)) | ^~~~~~~~~
Quoted 9 lines
cc1: some warnings being treated as errors
Fixes 573ae4f13f63 ("tee: add overflow check in register_shm_helper()")Reported-by kernel test robot <[email protected]>Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/tee_shm.c | 1 + 1 file changed, 1 insertion(+)
-Sumit
Quoted 15 lines
drivers/tee/tee_shm.c +1
-1@@ -9,6 +9,7 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/tee_drv.h> +#include <linux/uaccess.h> #include <linux/uio.h> #include "tee_private.h" --2.31.1
Quoted 18 lines · Sumit Garg
Quoted 6 lines · Jens Wiklander
Include <
linux/uaccess.h> to avoid the warning:
drivers/tee/tee_shm.c: In function 'tee_shm_register':Quoted 1 line
Quoted 1 line
drivers/tee/tee_shm.c:242:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]242 | if (!access_ok((void __user *)addr, length)) | ^~~~~~~~~Quoted 9 lines
cc1: some warnings being treated as errors
Fixes 573ae4f13f63 ("tee: add overflow check in register_shm_helper()")Reported-by kernel test robot <[email protected]>Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/tee_shm.c | 1 + 1 file changed, 1 insertion(+)
Quoted 1 line
Reviewed-by Sumit Garg <[email protected]>
Thanks, I'm picking this up now.
Cheers,
Jens
Quoted 18 lines
-Sumit
Quoted 15 lines
drivers/tee/tee_shm.c +1
-1@@ -9,6 +9,7 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/tee_drv.h> +#include <linux/uaccess.h> #include <linux/uio.h> #include "tee_private.h" --2.31.1