aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/selection.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/selection.c')
-rw-r--r--drivers/char/selection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index f29fbe9b8ed7..cb8ca5698963 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -268,7 +268,7 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t
268 268
269 /* Allocate a new buffer before freeing the old one ... */ 269 /* Allocate a new buffer before freeing the old one ... */
270 multiplier = use_unicode ? 3 : 1; /* chars can take up to 3 bytes */ 270 multiplier = use_unicode ? 3 : 1; /* chars can take up to 3 bytes */
271 bp = kmalloc((sel_end-sel_start)/2*multiplier+1, GFP_KERNEL); 271 bp = kmalloc(((sel_end-sel_start)/2+1)*multiplier, GFP_KERNEL);
272 if (!bp) { 272 if (!bp) {
273 printk(KERN_WARNING "selection: kmalloc() failed\n"); 273 printk(KERN_WARNING "selection: kmalloc() failed\n");
274 clear_selection(); 274 clear_selection();