summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d41f46f)
raw | patch | inline | side by side (parent: d41f46f)
author | Hugh Dickins <hughd@google.com> | |
Tue, 5 Dec 2017 04:13:35 +0000 (20:13 -0800) | ||
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
Fri, 5 Jan 2018 14:44:25 +0000 (15:44 +0100) |
An error from kaiser_add_mapping() here is not at all likely, but
Eric Biggers rightly points out that __free_ldt_struct() relies on
new_ldt->size being initialized: move that up.
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Eric Biggers rightly points out that __free_ldt_struct() relies on
new_ldt->size being initialized: move that up.
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/ldt.c | patch | blob | history |
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index 89ee37469d41a09e5bac885ac8ad32cc3cfd8b28..bc429365b72a9674bb75ddc099351d5172317e87 100644 (file)
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
ret = kaiser_add_mapping((unsigned long)new_ldt->entries, alloc_size,
__PAGE_KERNEL);
+ new_ldt->size = size;
if (ret) {
__free_ldt_struct(new_ldt);
return NULL;
}
- new_ldt->size = size;
return new_ldt;
}