Commit b73c3156 authored by David S. Miller's avatar David S. Miller

[NET]: Fix ppp_async tty discipline module ref counting.

parent 189ea5d0
...@@ -147,7 +147,6 @@ ppp_asynctty_open(struct tty_struct *tty) ...@@ -147,7 +147,6 @@ ppp_asynctty_open(struct tty_struct *tty)
struct asyncppp *ap; struct asyncppp *ap;
int err; int err;
MOD_INC_USE_COUNT;
err = -ENOMEM; err = -ENOMEM;
ap = kmalloc(sizeof(*ap), GFP_KERNEL); ap = kmalloc(sizeof(*ap), GFP_KERNEL);
if (ap == 0) if (ap == 0)
...@@ -183,7 +182,6 @@ ppp_asynctty_open(struct tty_struct *tty) ...@@ -183,7 +182,6 @@ ppp_asynctty_open(struct tty_struct *tty)
out_free: out_free:
kfree(ap); kfree(ap);
out: out:
MOD_DEC_USE_COUNT;
return err; return err;
} }
...@@ -223,7 +221,6 @@ ppp_asynctty_close(struct tty_struct *tty) ...@@ -223,7 +221,6 @@ ppp_asynctty_close(struct tty_struct *tty)
if (ap->tpkt != 0) if (ap->tpkt != 0)
kfree_skb(ap->tpkt); kfree_skb(ap->tpkt);
kfree(ap); kfree(ap);
MOD_DEC_USE_COUNT;
} }
/* /*
...@@ -351,6 +348,7 @@ ppp_asynctty_wakeup(struct tty_struct *tty) ...@@ -351,6 +348,7 @@ ppp_asynctty_wakeup(struct tty_struct *tty)
static struct tty_ldisc ppp_ldisc = { static struct tty_ldisc ppp_ldisc = {
.owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC, .magic = TTY_LDISC_MAGIC,
.name = "ppp", .name = "ppp",
.open = ppp_asynctty_open, .open = ppp_asynctty_open,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment