Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
28f23c1a
Commit
28f23c1a
authored
Mar 08, 2003
by
Russell King
Committed by
Linus Torvalds
Mar 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SERIAL] Add ttydriver->owner initialisation.
parent
842cd3cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
20 deletions
+4
-20
drivers/serial/core.c
drivers/serial/core.c
+4
-20
No files found.
drivers/serial/core.c
View file @
28f23c1a
...
...
@@ -1288,7 +1288,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
wake_up_interruptible
(
&
info
->
open_wait
);
done:
module_put
(
drv
->
owner
)
;
;
}
static
void
uart_wait_until_sent
(
struct
tty_struct
*
tty
,
int
timeout
)
...
...
@@ -1571,29 +1571,14 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
if
(
line
>=
tty
->
driver
.
num
)
goto
fail
;
/*
* If we fail to increment the module use count, we can't have
* any other users of this tty (since this implies that the module
* is about to be unloaded). Therefore, it is safe to set
* tty->driver_data to be NULL, so uart_close() doesn't bite us.
*/
if
(
!
try_module_get
(
drv
->
owner
))
{
tty
->
driver_data
=
NULL
;
goto
fail
;
}
/*
* FIXME: This one isn't fun. We can't guarantee that the tty isn't
* already in open, nor can we guarantee the state of tty->driver_data
*/
info
=
uart_get
(
drv
,
line
);
retval
=
-
ENOMEM
;
if
(
!
info
)
{
if
(
tty
->
driver_data
)
goto
fail
;
else
goto
out
;
}
if
(
!
info
)
goto
fail
;
/*
* Once we set tty->driver_data here, we are guaranteed that
...
...
@@ -1656,8 +1641,6 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
return
retval
;
out:
module_put
(
drv
->
owner
);
fail:
return
retval
;
}
...
...
@@ -2186,6 +2169,7 @@ int uart_register_driver(struct uart_driver *drv)
drv
->
tty_driver
=
normal
;
normal
->
magic
=
TTY_DRIVER_MAGIC
;
normal
->
owner
=
drv
->
owner
;
normal
->
driver_name
=
drv
->
driver_name
;
normal
->
name
=
drv
->
dev_name
;
normal
->
major
=
drv
->
major
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment