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
e02f27ca
Commit
e02f27ca
authored
Sep 25, 2003
by
Randy Dunlap
Committed by
Linus Torvalds
Sep 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] janitor: rio_linux: user get/put_user for errors (not
From: Domen Puncer <domen@coderock.org>
parent
acf658db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
drivers/char/rio/rio_linux.c
drivers/char/rio/rio_linux.c
+6
-14
No files found.
drivers/char/rio/rio_linux.c
View file @
e02f27ca
...
@@ -689,9 +689,7 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp,
...
@@ -689,9 +689,7 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp,
break;
break;
#endif
#endif
case
TIOCSSOFTCAR
:
case
TIOCSSOFTCAR
:
if
((
rc
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
if
((
rc
=
get_user
(
ival
,
(
unsigned
int
*
)
arg
))
==
0
)
{
sizeof
(
int
)))
==
0
)
{
get_user
(
ival
,
(
unsigned
int
*
)
arg
);
tty
->
termios
->
c_cflag
=
tty
->
termios
->
c_cflag
=
(
tty
->
termios
->
c_cflag
&
~
CLOCAL
)
|
(
tty
->
termios
->
c_cflag
&
~
CLOCAL
)
|
(
ival
?
CLOCAL
:
0
);
(
ival
?
CLOCAL
:
0
);
...
@@ -741,25 +739,19 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp,
...
@@ -741,25 +739,19 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp,
}
}
break;
break;
case TIOCMBIS:
case TIOCMBIS:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
((ival & TIOCM_RTS) ? 1 : -1));
((ival & TIOCM_RTS) ? 1 : -1));
}
}
break;
break;
case TIOCMBIC:
case TIOCMBIC:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
rio_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
rio_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
((ival & TIOCM_RTS) ? 0 : -1));
((ival & TIOCM_RTS) ? 0 : -1));
}
}
break;
break;
case TIOCMSET:
case TIOCMSET:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
((ival & TIOCM_RTS) ? 1 : 0));
((ival & TIOCM_RTS) ? 1 : 0));
}
}
...
@@ -1010,9 +1002,9 @@ static int rio_init_datastructures (void)
...
@@ -1010,9 +1002,9 @@ static int rio_init_datastructures (void)
free6:
for
(
i
--
;
i
>=
0
;
i
--
)
free6:
for
(
i
--
;
i
>=
0
;
i
--
)
kfree
(
p
->
RIOPortp
[
i
]);
kfree
(
p
->
RIOPortp
[
i
]);
/*free5:
*/
/*free5:
free4:
free4:
free3:
kfree
(
p
->
RIOPortp
);
free3:
*/
kfree
(
p
->
RIOPortp
);
free2:
kfree
(
p
->
RIOHosts
);
free2:
kfree
(
p
->
RIOHosts
);
free1:
free1:
rio_dprintk
(
RIO_DEBUG_INIT
,
"Not enough memory! %p %p %p
\n
"
,
rio_dprintk
(
RIO_DEBUG_INIT
,
"Not enough memory! %p %p %p
\n
"
,
...
...
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