diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-12-08 11:56:03 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-12-10 00:24:39 +0100 |
commit | 296dc5806de57dc84fce000d60fc201ba40f96e8 (patch) | |
tree | d2b7f637f70c5c0dafbd6e0f383c10119b098162 /arch/x86/kernel/ldt.c | |
parent | Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
download | linux-296dc5806de57dc84fce000d60fc201ba40f96e8.tar.xz linux-296dc5806de57dc84fce000d60fc201ba40f96e8.zip |
x86/ldt: Make a size argument unsigned
My static checker complains that we put an upper bound on the "size"
argument but not a lower bound. The checker is not smart enough to know
the possible ranges of "old_mm->context.ldt->size" from
init_new_context_ldt() so it thinks maybe it could be negative.
Let's make it unsigned to silence the warning and future proof the code
a bit.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: kernel-janitors@vger.kernel.org
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20161208105602.GA11382@elgon.mountain
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/ldt.c')
-rw-r--r-- | arch/x86/kernel/ldt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 6707039b9032..e25b6681cc65 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -34,7 +34,7 @@ static void flush_ldt(void *current_mm) } /* The caller must call finalize_ldt_struct on the result. LDT starts zeroed. */ -static struct ldt_struct *alloc_ldt_struct(int size) +static struct ldt_struct *alloc_ldt_struct(unsigned int size) { struct ldt_struct *new_ldt; int alloc_size; |