]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/selection.c
omap-fixes,
[linux-2.6-omap-h63xx.git] / drivers / char / selection.c
index f29fbe9b8ed7f27d775902a245d5a79d34f4e515..cb8ca5698963017d03ff6ed625ec41f0d0a6c062 100644 (file)
@@ -268,7 +268,7 @@ 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*multiplier+1, GFP_KERNEL);
+       bp = kmalloc(((sel_end-sel_start)/2+1)*multiplier, GFP_KERNEL);
        if (!bp) {
                printk(KERN_WARNING "selection: kmalloc() failed\n");
                clear_selection();