@@ -797,7 +797,7 @@ static int ds_release(struct inode *inode, struct file *file)
797
797
798
798
/*====================================================================*/
799
799
800
- static ssize_t ds_read (struct file * file , char * buf ,
800
+ static ssize_t ds_read (struct file * file , char __user * buf ,
801
801
size_t count , loff_t * ppos )
802
802
{
803
803
struct pcmcia_bus_socket * s ;
@@ -819,14 +819,14 @@ static ssize_t ds_read(struct file *file, char *buf,
819
819
820
820
ret = wait_event_interruptible (s -> queue , !queue_empty (user ));
821
821
if (ret == 0 )
822
- ret = put_user (get_queued_event (user ), (int * )buf ) ? - EFAULT : 4 ;
822
+ ret = put_user (get_queued_event (user ), (int __user * )buf ) ? - EFAULT : 4 ;
823
823
824
824
return ret ;
825
825
} /* ds_read */
826
826
827
827
/*====================================================================*/
828
828
829
- static ssize_t ds_write (struct file * file , const char * buf ,
829
+ static ssize_t ds_write (struct file * file , const char __user * buf ,
830
830
size_t count , loff_t * ppos )
831
831
{
832
832
struct pcmcia_bus_socket * s ;
@@ -849,7 +849,7 @@ static ssize_t ds_write(struct file *file, const char *buf,
849
849
850
850
if (s -> req_pending ) {
851
851
s -> req_pending -- ;
852
- get_user (s -> req_result , (int * )buf );
852
+ get_user (s -> req_result , (int __user * )buf );
853
853
if ((s -> req_result != 0 ) || (s -> req_pending == 0 ))
854
854
wake_up_interruptible (& s -> request );
855
855
} else
@@ -888,6 +888,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
888
888
u_int cmd , u_long arg )
889
889
{
890
890
struct pcmcia_bus_socket * s ;
891
+ void __user * uarg = (char __user * )arg ;
891
892
u_int size ;
892
893
int ret , err ;
893
894
ds_ioctl_arg_t buf ;
@@ -911,14 +912,14 @@ static int ds_ioctl(struct inode * inode, struct file * file,
911
912
return - EPERM ;
912
913
913
914
if (cmd & IOC_IN ) {
914
- err = verify_area (VERIFY_READ , ( char * ) arg , size );
915
+ err = verify_area (VERIFY_READ , uarg , size );
915
916
if (err ) {
916
917
ds_dbg (3 , "ds_ioctl(): verify_read = %d\n" , err );
917
918
return err ;
918
919
}
919
920
}
920
921
if (cmd & IOC_OUT ) {
921
- err = verify_area (VERIFY_WRITE , ( char * ) arg , size );
922
+ err = verify_area (VERIFY_WRITE , uarg , size );
922
923
if (err ) {
923
924
ds_dbg (3 , "ds_ioctl(): verify_write = %d\n" , err );
924
925
return err ;
@@ -927,7 +928,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
927
928
928
929
err = ret = 0 ;
929
930
930
- if (cmd & IOC_IN ) __copy_from_user ((char * )& buf , ( char * ) arg , size );
931
+ if (cmd & IOC_IN ) __copy_from_user ((char * )& buf , uarg , size );
931
932
932
933
switch (cmd ) {
933
934
case DS_ADJUST_RESOURCE_INFO :
@@ -1042,7 +1043,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
1042
1043
}
1043
1044
}
1044
1045
1045
- if (cmd & IOC_OUT ) __copy_to_user (( char * ) arg , (char * )& buf , size );
1046
+ if (cmd & IOC_OUT ) __copy_to_user (uarg , (char * )& buf , size );
1046
1047
1047
1048
return err ;
1048
1049
} /* ds_ioctl */
0 commit comments