summaryrefslogtreecommitdiff
path: root/drivers/dma/virt-dma.h
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-10-29 12:32:16 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-04 16:43:38 +0100
commit07edff9265204e15c9fc8d07cc69e38c4c484e15 (patch)
tree41bac874491adee454224fd78c666d8d7564d58e /drivers/dma/virt-dma.h
parent9788c950ed4ad2020a7f2e8231abaf77e49d871a (diff)
vt: keyboard, reorder user buffer handling in vt_do_kdgkb_ioctl
KDGKBSENT (the getter) needs only 'user_kdgkb->kb_func' from the userspace, i.e. the index. Then it needs a buffer for a local copy of 'kb_string'. KDSKBSENT (the setter) needs a copy up to the length of 'user_kdgkb->kb_string'. That means, we obtain the index before the switch-case and use it in both paths and: 1) allocate full space in the getter case, and 2) copy the string only in the setter case. We do it by strndup_user helper now which was not available when this function was written. Given we copy the two members of 'struct kbsentry' separately, we no longer need a local definition. Hence we need to change all the sizeofs here too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dma/virt-dma.h')
0 files changed, 0 insertions, 0 deletions