@@ -165,7 +165,7 @@ static int dsp56k_reset(void)
165165 return 0 ;
166166}
167167
168- static int dsp56k_upload (u_char * bin , int len )
168+ static int dsp56k_upload (u_char __user * bin , int len )
169169{
170170 int i ;
171171 u_char * p ;
@@ -199,7 +199,7 @@ static int dsp56k_upload(u_char *bin, int len)
199199 return 0 ;
200200}
201201
202- static ssize_t dsp56k_read (struct file * file , char * buf , size_t count ,
202+ static ssize_t dsp56k_read (struct file * file , char __user * buf , size_t count ,
203203 loff_t * ppos )
204204{
205205 struct inode * inode = file -> f_dentry -> d_inode ;
@@ -225,10 +225,10 @@ static ssize_t dsp56k_read(struct file *file, char *buf, size_t count,
225225 }
226226 case 2 : /* 16 bit */
227227 {
228- short * data ;
228+ short __user * data ;
229229
230230 count /= 2 ;
231- data = (short * ) buf ;
231+ data = (short __user * ) buf ;
232232 handshake (count , dsp56k .maxio , dsp56k .timeout , DSP56K_RECEIVE ,
233233 put_user (dsp56k_host_interface .data .w [1 ], data + n ++ ));
234234 return 2 * n ;
@@ -244,10 +244,10 @@ static ssize_t dsp56k_read(struct file *file, char *buf, size_t count,
244244 }
245245 case 4 : /* 32 bit */
246246 {
247- long * data ;
247+ long __user * data ;
248248
249249 count /= 4 ;
250- data = (long * ) buf ;
250+ data = (long __user * ) buf ;
251251 handshake (count , dsp56k .maxio , dsp56k .timeout , DSP56K_RECEIVE ,
252252 put_user (dsp56k_host_interface .data .l , data + n ++ ));
253253 return 4 * n ;
@@ -262,7 +262,7 @@ static ssize_t dsp56k_read(struct file *file, char *buf, size_t count,
262262 }
263263}
264264
265- static ssize_t dsp56k_write (struct file * file , const char * buf , size_t count ,
265+ static ssize_t dsp56k_write (struct file * file , const char __user * buf , size_t count ,
266266 loff_t * ppos )
267267{
268268 struct inode * inode = file -> f_dentry -> d_inode ;
@@ -287,10 +287,10 @@ static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count,
287287 }
288288 case 2 : /* 16 bit */
289289 {
290- const short * data ;
290+ const short __user * data ;
291291
292292 count /= 2 ;
293- data = (const short * )buf ;
293+ data = (const short __user * )buf ;
294294 handshake (count , dsp56k .maxio , dsp56k .timeout , DSP56K_TRANSMIT ,
295295 get_user (dsp56k_host_interface .data .w [1 ], data + n ++ ));
296296 return 2 * n ;
@@ -306,10 +306,10 @@ static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count,
306306 }
307307 case 4 : /* 32 bit */
308308 {
309- const long * data ;
309+ const long __user * data ;
310310
311311 count /= 4 ;
312- data = (const long * )buf ;
312+ data = (const long __user * )buf ;
313313 handshake (count , dsp56k .maxio , dsp56k .timeout , DSP56K_TRANSMIT ,
314314 get_user (dsp56k_host_interface .data .l , data + n ++ ));
315315 return 4 * n ;
@@ -328,6 +328,7 @@ static int dsp56k_ioctl(struct inode *inode, struct file *file,
328328 unsigned int cmd , unsigned long arg )
329329{
330330 int dev = iminor (inode ) & 0x0f ;
331+ void __user * argp = (void __user * )arg ;
331332
332333 switch (dev )
333334 {
@@ -336,9 +337,9 @@ static int dsp56k_ioctl(struct inode *inode, struct file *file,
336337 switch (cmd ) {
337338 case DSP56K_UPLOAD :
338339 {
339- char * bin ;
340+ char __user * bin ;
340341 int r , len ;
341- struct dsp56k_upload * binary = ( struct dsp56k_upload * ) arg ;
342+ struct dsp56k_upload __user * binary = argp ;
342343
343344 if (get_user (len , & binary -> len ) < 0 )
344345 return - EFAULT ;
@@ -372,7 +373,7 @@ static int dsp56k_ioctl(struct inode *inode, struct file *file,
372373 case DSP56K_HOST_FLAGS :
373374 {
374375 int dir , out , status ;
375- struct dsp56k_host_flags * hf = ( struct dsp56k_host_flags * ) arg ;
376+ struct dsp56k_host_flags __user * hf = argp ;
376377
377378 if (get_user (dir , & hf -> dir ) < 0 )
378379 return - EFAULT ;
0 commit comments