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