Commit 0b4e162c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fixup 68360 module refcounting

From: Christoph Hellwig <hch@lst.de>
parent 43653667
...@@ -1650,7 +1650,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) ...@@ -1650,7 +1650,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
if (tty_hung_up_p(filp)) { if (tty_hung_up_p(filp)) {
DBG_CNT("before DEC-hung"); DBG_CNT("before DEC-hung");
MOD_DEC_USE_COUNT;
local_irq_restore(flags); local_irq_restore(flags);
return; return;
} }
...@@ -1677,7 +1676,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) ...@@ -1677,7 +1676,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
} }
if (state->count) { if (state->count) {
DBG_CNT("before DEC-2"); DBG_CNT("before DEC-2");
MOD_DEC_USE_COUNT;
local_irq_restore(flags); local_irq_restore(flags);
return; return;
} }
...@@ -1732,7 +1730,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) ...@@ -1732,7 +1730,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
} }
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
wake_up_interruptible(&info->close_wait); wake_up_interruptible(&info->close_wait);
MOD_DEC_USE_COUNT;
local_irq_restore(flags); local_irq_restore(flags);
} }
...@@ -1993,14 +1990,12 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp) ...@@ -1993,14 +1990,12 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp)
if (retval) if (retval)
return retval; return retval;
MOD_INC_USE_COUNT;
retval = block_til_ready(tty, filp, info); retval = block_til_ready(tty, filp, info);
if (retval) { if (retval) {
#ifdef SERIAL_DEBUG_OPEN #ifdef SERIAL_DEBUG_OPEN
printk("rs_open returning after block_til_ready with %d\n", printk("rs_open returning after block_til_ready with %d\n",
retval); retval);
#endif #endif
MOD_DEC_USE_COUNT;
return retval; return retval;
} }
...@@ -2476,6 +2471,7 @@ long console_360_init(long kmem_start, long kmem_end) ...@@ -2476,6 +2471,7 @@ long console_360_init(long kmem_start, long kmem_end)
static int baud_idx; static int baud_idx;
static struct tty_operations rs_360_ops = { static struct tty_operations rs_360_ops = {
.owner = THIS_MODULE,
.open = rs_360_open, .open = rs_360_open,
.close = rs_360_close, .close = rs_360_close,
.write = rs_360_write, .write = rs_360_write,
......
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