public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/i386/kernel/signal.c: fix err test twice
@ 2005-01-19  9:59 Vincent Hanquez
  2005-01-19 13:43 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Hanquez @ 2005-01-19  9:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Hi, the following patch:
	- correct the err variable tested twice when _NSIG_WORDS == 1
	  (unlikely to happen, but ..)
	- remove some |= in favor of = because we don't need to 'pack' err

Please apply,

Signed-off-by: Vincent Hanquez <tab@snarc.org>

--- linux-2.6.10/arch/i386/kernel/signal.c.orig	2005-01-14 21:02:13 +0100
+++ linux-2.6.10/arch/i386/kernel/signal.c	2005-01-14 21:05:32 +0100
@@ -369,20 +369,20 @@
 		? current_thread_info()->exec_domain->signal_invmap[sig]
 		: sig;
 
-	err |= __put_user(usig, &frame->sig);
+	err = __put_user(usig, &frame->sig);
 	if (err)
 		goto give_sigsegv;
 
-	err |= setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]);
+	err = setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]);
 	if (err)
 		goto give_sigsegv;
 
 	if (_NSIG_WORDS > 1) {
-		err |= __copy_to_user(&frame->extramask, &set->sig[1],
+		err = __copy_to_user(&frame->extramask, &set->sig[1],
 				      sizeof(frame->extramask));
+		if (err)
+			goto give_sigsegv;
 	}
-	if (err)
-		goto give_sigsegv;
 
 	restorer = &__kernel_sigreturn;
 	if (ka->sa.sa_flags & SA_RESTORER)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] arch/i386/kernel/signal.c: fix err test twice
  2005-01-19  9:59 [PATCH] arch/i386/kernel/signal.c: fix err test twice Vincent Hanquez
@ 2005-01-19 13:43 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2005-01-19 13:43 UTC (permalink / raw)
  To: Vincent Hanquez; +Cc: Andrew Morton, linux-kernel


* Vincent Hanquez <tab@snarc.org> wrote:

> Hi, the following patch:
> 	- correct the err variable tested twice when _NSIG_WORDS == 1
> 	  (unlikely to happen, but ..)

(this isnt a problem, even if it happens. But worth cleaning up
nevertheless.)

> 	- remove some |= in favor of = because we don't need to 'pack' err
> 
> Please apply,
> 
> Signed-off-by: Vincent Hanquez <tab@snarc.org>

looks good.

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-19 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-19  9:59 [PATCH] arch/i386/kernel/signal.c: fix err test twice Vincent Hanquez
2005-01-19 13:43 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox