]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - drivers/tty/vt/selection.c
treewide: kmalloc() -> kmalloc_array()
[mirror_ubuntu-eoan-kernel.git] / drivers / tty / vt / selection.c
index 7851383fbd6c7d7cf567085be5165639b845092a..90ea1cc52b7aac91d6552ce161a16dc4036c3563 100644 (file)
@@ -280,7 +280,8 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t
 
        /* Allocate a new buffer before freeing the old one ... */
        multiplier = use_unicode ? 3 : 1;  /* chars can take up to 3 bytes */
-       bp = kmalloc(((sel_end-sel_start)/2+1)*multiplier, GFP_KERNEL);
+       bp = kmalloc_array((sel_end - sel_start) / 2 + 1, multiplier,
+                          GFP_KERNEL);
        if (!bp) {
                printk(KERN_WARNING "selection: kmalloc() failed\n");
                clear_selection();