lkml.org 
[lkml]   [2008]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: removes extra assignment from arch/x86/kernel/ldt.c
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


\
 
 \ /
  Last update: 2008-08-07 21:35    [W:0.026 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site