tty/vt: consolemap: walk the buffer only once in con_set_trans_old()
authorJiri Slaby <jslaby@suse.cz>
Tue, 7 Jun 2022 10:49:46 +0000 (12:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jun 2022 11:37:03 +0000 (13:37 +0200)
commit484923ad3ad1604efa666502ac507b1e3ee30e3b
tree1b6abb9562adf2d05a1a7b1b0a20826394fb31c5
parentfc440658346e1bff9b6661467f55856d1df1cdb2
tty/vt: consolemap: walk the buffer only once in con_set_trans_old()

Fetch the user data one by one (by get_user()) and fill in the local
buffer simultaneously. I.e. we no longer require to walk two buffers and
save thus 256 B from stack (whole ubuf).

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220607104946.18710-36-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/consolemap.c