* [rfc] i386/math-emu: __copy_to_user (and missing semicolon?) [possible patch included]
@ 2005-01-06 0:45 Jesper Juhl
0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2005-01-06 0:45 UTC (permalink / raw)
To: Bill Metzenthen; +Cc: lkml
Hi,
building a few 'make randconfig's I noticed this :
CC arch/i386/math-emu/fpu_entry.o
include/asm/uaccess.h: In function `save_i387_soft':
arch/i386/math-emu/fpu_entry.c:745: warning: ignoring return value of `__copy_to_user', declared with attribute warn_unused_result
When I took a look I saw what looked like a missing semicolon and indeed
the return value of __copy_to_user was being ignored (but a few lines from
there another instance /was/ being tested).
That seems wrong.
I'll admit that I'm not familliar with the code in fpu_entry.c and I've
only done a very cursory investigation to see if the patch below is
actually correct (all I can really say is that it now compiles without
warnings with the patch below).
Would something like this patch make sense? or am I missing something
somewhere? Any comments are welcome.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
diff -up linux-2.6.10-bk8-orig/arch/i386/math-emu/fpu_entry.c linux-2.6.10-bk8/arch/i386/math-emu/fpu_entry.c
--- linux-2.6.10-bk8-orig/arch/i386/math-emu/fpu_entry.c 2004-12-24 22:35:25.000000000 +0100
+++ linux-2.6.10-bk8/arch/i386/math-emu/fpu_entry.c 2005-01-06 01:28:28.000000000 +0100
@@ -742,7 +742,8 @@ int save_i387_soft(void *s387, struct _f
S387->fcs &= ~0xf8000000;
S387->fos |= 0xffff0000;
#endif /* PECULIAR_486 */
- __copy_to_user(d, &S387->cwd, 7*4);
+ if (__copy_to_user(d, &S387->cwd, 7*4))
+ return -1;
RE_ENTRANT_CHECK_ON;
d += 7*4;
@@ -753,7 +754,7 @@ int save_i387_soft(void *s387, struct _f
return -1;
if ( offset )
if (__copy_to_user(d+other, (u_char *)&S387->st_space, offset))
- return -1
+ return -1;
RE_ENTRANT_CHECK_ON;
return 1;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-06 0:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-06 0:45 [rfc] i386/math-emu: __copy_to_user (and missing semicolon?) [possible patch included] Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).