diff options
Diffstat (limited to 'drivers/char/hvc_console.c')
-rw-r--r-- | drivers/char/hvc_console.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index ba55bba151b9..35cca4c7fb18 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/spinlock.h> | 38 | #include <linux/spinlock.h> |
39 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
40 | #include <linux/freezer.h> | 40 | #include <linux/freezer.h> |
41 | #include <linux/slab.h> | ||
41 | 42 | ||
42 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
43 | 44 | ||
@@ -367,16 +368,12 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) | |||
367 | hp = tty->driver_data; | 368 | hp = tty->driver_data; |
368 | 369 | ||
369 | spin_lock_irqsave(&hp->lock, flags); | 370 | spin_lock_irqsave(&hp->lock, flags); |
370 | tty_kref_get(tty); | ||
371 | 371 | ||
372 | if (--hp->count == 0) { | 372 | if (--hp->count == 0) { |
373 | /* We are done with the tty pointer now. */ | 373 | /* We are done with the tty pointer now. */ |
374 | hp->tty = NULL; | 374 | hp->tty = NULL; |
375 | spin_unlock_irqrestore(&hp->lock, flags); | 375 | spin_unlock_irqrestore(&hp->lock, flags); |
376 | 376 | ||
377 | /* Put the ref obtained in hvc_open() */ | ||
378 | tty_kref_put(tty); | ||
379 | |||
380 | if (hp->ops->notifier_del) | 377 | if (hp->ops->notifier_del) |
381 | hp->ops->notifier_del(hp, hp->data); | 378 | hp->ops->notifier_del(hp, hp->data); |
382 | 379 | ||