diff options
author | David S. Miller <davem@davemloft.net> | 2009-02-03 09:15:35 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-03 09:15:35 +0100 |
commit | b3ff29d2ccfe3af065a9b393699a8fbf2abd1b15 (patch) | |
tree | 99e5b423473097756353d038f922b2623f3edd2a /drivers/char | |
parent | tun: Check supplemental groups in TUN/TAP driver. (diff) | |
parent | Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds... (diff) | |
download | linux-b3ff29d2ccfe3af065a9b393699a8fbf2abd1b15.tar.xz linux-b3ff29d2ccfe3af065a9b393699a8fbf2abd1b15.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/Kconfig
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/selection.c | 2 | ||||
-rw-r--r-- | drivers/char/tty_io.c | 4 |
2 files changed, 4 insertions, 2 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 /* 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(); diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index d33e5ab06177..bc84e125c6bc 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1817,8 +1817,10 @@ got_driver: /* check whether we're reopening an existing tty */ tty = tty_driver_lookup_tty(driver, inode, index); - if (IS_ERR(tty)) + if (IS_ERR(tty)) { + mutex_unlock(&tty_mutex); return PTR_ERR(tty); + } } if (tty) { |