vt: use memdup_user in PIO_UNIMAP ioctl
Again, a nice linear transfer that simplifies the code. Signed-off-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
915f0a8d28
Коммит
4f1be1b5d9
|
@ -540,14 +540,9 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
|
||||||
if (!ct)
|
if (!ct)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unilist = kmalloc_array(ct, sizeof(struct unipair), GFP_KERNEL);
|
unilist = memdup_user(list, ct * sizeof(struct unipair));
|
||||||
if (!unilist)
|
if (IS_ERR(unilist))
|
||||||
return -ENOMEM;
|
return PTR_ERR(unilist);
|
||||||
|
|
||||||
for (i = ct, plist = unilist; i; i--, plist++, list++) {
|
|
||||||
__get_user(plist->unicode, &list->unicode);
|
|
||||||
__get_user(plist->fontpos, &list->fontpos);
|
|
||||||
}
|
|
||||||
|
|
||||||
console_lock();
|
console_lock();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче