[PATCH v3] staging: vt6655: ioctl.c - missing __user annotation

Anil Belur askb23 at gmail.com
Wed Jul 30 12:59:57 UTC 2014


- private_ioctl() internally calls copy_{to,from}_user() and does
  not use '__user' which gives out several sparse warnings
- these sparse warnings were fixed by adding __user annotation to
  the data member of struct tagSCmdRequest:

 drivers/staging/vt6655/ioctl.c:78:51: warning: incorrect type in argument 2 (different address spaces)
 drivers/staging/vt6655/ioctl.c:78:51:    expected void const [noderef] asn:1>*from
 drivers/staging/vt6655/ioctl.c:78:51:    got void *data

Signed-off-by: Anil Belur <askb23 at gmail.com>
---
v2:
- replaced the 'void __user *' casts by adding '__user' annotation to the data member of struct
  tagSCmdRequest which is much cleaner approach as suggested by tklauser at distanz.ch
v1:
- added 'void __user *' casts to supress the warnings

 drivers/staging/vt6655/iocmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
index e499f1b..dd12498 100644
--- a/drivers/staging/vt6655/iocmd.h
+++ b/drivers/staging/vt6655/iocmd.h
@@ -100,7 +100,7 @@ typedef enum tagWZONETYPE {
 #pragma pack(1)
 typedef struct tagSCmdRequest {
 	u8	    name[16];
-	void	*data;
+	void __user *data;
 	u16	    wResult;
 	u16     wCmdCode;
 } SCmdRequest, *PSCmdRequest;
-- 
1.9.1



More information about the devel mailing list