]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/char/selection.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
[mv-sheeva.git] / drivers / char / selection.c
index 2978a49a172b0cdba3d91814fd3b68b614645fea..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();
@@ -306,7 +306,7 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t
  */
 int paste_selection(struct tty_struct *tty)
 {
-       struct vc_data *vc = (struct vc_data *)tty->driver_data;
+       struct vc_data *vc = tty->driver_data;
        int     pasted = 0;
        unsigned int count;
        struct  tty_ldisc *ld;