* [PATCH] x86: removes extra assignment from arch/x86/kernel/ldt.c
@ 2008-08-06 13:33 Rakib Mullick
2008-08-07 19:32 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 2+ messages in thread
From: Rakib Mullick @ 2008-08-06 13:33 UTC (permalink / raw)
To: mingo; +Cc: linux-kernel
Hello guys, this patch removes an extra assignment from "write_ldt" function.
Thanks.
Signed-off-by : Md.Rakib H. Mullick (rakib.mullick@gmail.com)
--- linux-2.6.27-rc2.orig/arch/x86/kernel/ldt.c 2008-08-06
16:23:53.000000000 +0600
+++ linux-2.6.27-rc2/arch/x86/kernel/ldt.c 2008-08-06 19:18:50.984268144 +0600
@@ -191,11 +191,12 @@ static int write_ldt(void __user *ptr, u
error = -EINVAL;
if (bytecount != sizeof(ldt_info))
goto out;
- error = -EFAULT;
- if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info)))
+
+ if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info))) {
+ error = -EFAULT;
goto out;
+ }
- error = -EINVAL;
if (ldt_info.entry_number >= LDT_ENTRIES)
goto out;
if (ldt_info.contents == 3) {
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] x86: removes extra assignment from arch/x86/kernel/ldt.c
2008-08-06 13:33 [PATCH] x86: removes extra assignment from arch/x86/kernel/ldt.c Rakib Mullick
@ 2008-08-07 19:32 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2008-08-07 19:32 UTC (permalink / raw)
To: Rakib Mullick; +Cc: mingo, linux-kernel
Rakib Mullick wrote:
> Hello guys, this patch removes an extra assignment from "write_ldt" function.
> Thanks.
>
> Signed-off-by : Md.Rakib H. Mullick (rakib.mullick@gmail.com)
>
> --- linux-2.6.27-rc2.orig/arch/x86/kernel/ldt.c 2008-08-06
> 16:23:53.000000000 +0600
> +++ linux-2.6.27-rc2/arch/x86/kernel/ldt.c 2008-08-06 19:18:50.984268144 +0600
> @@ -191,11 +191,12 @@ static int write_ldt(void __user *ptr, u
> error = -EINVAL;
> if (bytecount != sizeof(ldt_info))
> goto out;
> - error = -EFAULT;
> - if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info)))
> +
> + if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info))) {
> + error = -EFAULT;
> goto out;
> + }
>
It would be better to move the EFAULT check up above so the EINVAL
checks are adjacent.
J
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-07 19:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-06 13:33 [PATCH] x86: removes extra assignment from arch/x86/kernel/ldt.c Rakib Mullick
2008-08-07 19:32 ` Jeremy Fitzhardinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox