aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/selection.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-04 14:54:56 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-04 14:54:56 +0100
commitbb960a1e42042e82447a5bc0941b3ab6d614bac3 (patch)
treed2295a923fabb1b01b25bb015c4c2e42ee9df5ca /drivers/char/selection.c
parent858770619debfb9269add63e4ba8b7c6b5538dd1 (diff)
parent06fc732c33a7ff5e4c91bcf4a6ca86b5e335ad9a (diff)
Merge branch 'core/xen' into x86/urgent
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 f29fbe9b8ed..cb8ca569896 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
/* 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();