Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f1be1b5 authored by Adam Borowski's avatar Adam Borowski Committed by Greg Kroah-Hartman
Browse files

vt: use memdup_user in PIO_UNIMAP ioctl



Again, a nice linear transfer that simplifies the code.

Signed-off-by: default avatarAdam Borowski <kilobyte@angband.pl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 915f0a8d
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -540,14 +540,9 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
	if (!ct)
		return 0;

	unilist = kmalloc_array(ct, sizeof(struct unipair), GFP_KERNEL);
	if (!unilist)
		return -ENOMEM;

	for (i = ct, plist = unilist; i; i--, plist++, list++) {
		__get_user(plist->unicode, &list->unicode);
		__get_user(plist->fontpos, &list->fontpos);
	}
	unilist = memdup_user(list, ct * sizeof(struct unipair));
	if (IS_ERR(unilist))
		return PTR_ERR(unilist);

	console_lock();