lkml.org 
[lkml]   [2004]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Kill a sparse warning in binfmt_elf.c
From
Date
On Wed, 06 Oct 2004 15:45:02 PDT, Arun Sharma said:

> The attached patch kills a sparse warning in binfmt_elf.c:dump_write() by
> adding a __user annotation.

> static int dump_write(struct file *file, const void *addr, int nr)
> {
> - return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
> + return file->f_op->write(file, (const char __user *) addr, nr, &file->f_pos) == nr;
> }

wouldn't it be more useful to put the annotation into the *prototype* for
the dump_write() function, so that we get sparse typechecking for the
caller(s) of this function? Your fix just kills the warning - when the *real*
problem is that we're called with a 'void *' that we then cast to something
without any real double check on what it is....
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.058 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site