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