projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbcb6d6
)
tty: Fix leaks introduced by the shift to separate ldisc objects
author
Alan Cox
<
[email protected]
>
Mon, 15 Jun 2009 15:28:29 +0000
(16:28 +0100)
committer
Linus Torvalds
<
[email protected]
>
Tue, 16 Jun 2009 18:24:00 +0000
(11:24 -0700)
Gold star for the kmemleak detector.
Signed-off-by: Alan Cox <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/char/tty_ldisc.c
patch
|
blob
|
history
diff --git
a/drivers/char/tty_ldisc.c
b/drivers/char/tty_ldisc.c
index 39c8f86dedd49c9e60ebe1e4e218225416bf0375..94b3e06d73ec255316db59749e417ae2bee90ffe 100644
(file)
--- a/
drivers/char/tty_ldisc.c
+++ b/
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: