aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp_async.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ppp_async.c')
-rw-r--r--drivers/net/ppp_async.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 1fd319bf758e..17c116bb332c 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -132,15 +132,13 @@ static DEFINE_RWLOCK(disc_data_lock);
132 132
133static struct asyncppp *ap_get(struct tty_struct *tty) 133static struct asyncppp *ap_get(struct tty_struct *tty)
134{ 134{
135 unsigned long flags;
136 struct asyncppp *ap; 135 struct asyncppp *ap;
137 136
138 read_lock_irqsave(&disc_data_lock, flags); 137 read_lock(&disc_data_lock);
139 ap = tty->disc_data; 138 ap = tty->disc_data;
140 if (ap != NULL) 139 if (ap != NULL)
141 atomic_inc(&ap->refcnt); 140 atomic_inc(&ap->refcnt);
142 read_unlock_irqrestore(&disc_data_lock, flags); 141 read_unlock(&disc_data_lock);
143
144 return ap; 142 return ap;
145} 143}
146 144
@@ -217,13 +215,12 @@ ppp_asynctty_open(struct tty_struct *tty)
217static void 215static void
218ppp_asynctty_close(struct tty_struct *tty) 216ppp_asynctty_close(struct tty_struct *tty)
219{ 217{
220 unsigned long flags;
221 struct asyncppp *ap; 218 struct asyncppp *ap;
222 219
223 write_lock_irqsave(&disc_data_lock, flags); 220 write_lock_irq(&disc_data_lock);
224 ap = tty->disc_data; 221 ap = tty->disc_data;
225 tty->disc_data = NULL; 222 tty->disc_data = NULL;
226 write_unlock_irqrestore(&disc_data_lock, flags); 223 write_unlock_irq(&disc_data_lock);
227 if (!ap) 224 if (!ap)
228 return; 225 return;
229 226