From fa542b3f655114c2fe18b04ea9eba4ca5a53635b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 15 Jun 2009 16:28:29 +0100 Subject: [PATCH] --- yaml --- r: 150989 b: refs/heads/master c: 46a50661fc95d4acf5e4c203f7889234238ce642 h: refs/heads/master i: 150987: 4483054e30cd9eb5bef16d123c11b39411464f94 v: v3 --- [refs] | 2 +- trunk/drivers/char/tty_ldisc.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index e7136eb263c1..9a448c849a89 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cbcb6d66af4c6169ce1c2d01a3ab345f04b8359d +refs/heads/master: 46a50661fc95d4acf5e4c203f7889234238ce642 diff --git a/trunk/drivers/char/tty_ldisc.c b/trunk/drivers/char/tty_ldisc.c index 39c8f86dedd4..94b3e06d73ec 100644 --- a/trunk/drivers/char/tty_ldisc.c +++ b/trunk/drivers/char/tty_ldisc.c @@ -148,8 +148,10 @@ static struct tty_ldisc *tty_ldisc_try_get(int disc) } } spin_unlock_irqrestore(&tty_ldisc_lock, flags); - if (err) + if (err) { + kfree(ld); return ERR_PTR(err); + } return ld; } @@ -262,7 +264,7 @@ const struct file_operations tty_ldiscs_proc_fops = { * @ld: line discipline * * Install an instance of a line discipline into a tty structure. The - * ldisc must have a reference count above zero to ensure it remains/ + * ldisc must have a reference count above zero to ensure it remains. * The tty instance refcount starts at zero. * * Locking: