mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 15:26:21 +09:00
kaiser: fix unlikely error in alloc_ldt_struct()
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3df1461787
commit
cb7d8d7e67
|
@ -79,11 +79,11 @@ static struct ldt_struct *alloc_ldt_struct(int size)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user