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
nexedi
linux
Commits
5be694bd
Commit
5be694bd
authored
Aug 30, 2003
by
Alexander Viro
Committed by
Linus Torvalds
Aug 30, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] dev_t handling cleanups (2/12)
tty_paranoia_check() switched from kdev_t to struct inode.
parent
836af7ab
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
arch/parisc/kernel/ioctl32.c
arch/parisc/kernel/ioctl32.c
+1
-1
drivers/char/tty_io.c
drivers/char/tty_io.c
+9
-9
fs/compat_ioctl.c
fs/compat_ioctl.c
+1
-1
include/linux/tty.h
include/linux/tty.h
+1
-1
No files found.
arch/parisc/kernel/ioctl32.c
View file @
5be694bd
...
...
@@ -1426,7 +1426,7 @@ static int vt_check(struct file *file)
return
-
EINVAL
;
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
inode
->
i_rdev
,
"tty_ioctl"
))
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_ioctl"
))
return
-
EINVAL
;
if
(
tty
->
driver
->
ioctl
!=
vt_ioctl
)
...
...
drivers/char/tty_io.c
View file @
5be694bd
...
...
@@ -177,7 +177,7 @@ char *tty_name(struct tty_struct *tty, char *buf)
EXPORT_SYMBOL
(
tty_name
);
inline
int
tty_paranoia_check
(
struct
tty_struct
*
tty
,
kdev_t
devic
e
,
inline
int
tty_paranoia_check
(
struct
tty_struct
*
tty
,
struct
inode
*
inod
e
,
const
char
*
routine
)
{
#ifdef TTY_PARANOIA_CHECK
...
...
@@ -187,11 +187,11 @@ inline int tty_paranoia_check(struct tty_struct *tty, kdev_t device,
"Warning: null TTY for (%s) in %s
\n
"
;
if
(
!
tty
)
{
printk
(
badtty
,
cdevname
(
device
),
routine
);
printk
(
badtty
,
cdevname
(
inode
->
i_rdev
),
routine
);
return
1
;
}
if
(
tty
->
magic
!=
TTY_MAGIC
)
{
printk
(
badmagic
,
cdevname
(
device
),
routine
);
printk
(
badmagic
,
cdevname
(
inode
->
i_rdev
),
routine
);
return
1
;
}
#endif
...
...
@@ -646,7 +646,7 @@ static ssize_t tty_read(struct file * file, char * buf, size_t count,
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
inode
=
file
->
f_dentry
->
d_inode
;
if
(
tty_paranoia_check
(
tty
,
inode
->
i_rdev
,
"tty_read"
))
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_read"
))
return
-
EIO
;
if
(
!
tty
||
(
test_bit
(
TTY_IO_ERROR
,
&
tty
->
flags
)))
return
-
EIO
;
...
...
@@ -763,7 +763,7 @@ static ssize_t tty_write(struct file * file, const char * buf, size_t count,
}
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
inode
->
i_rdev
,
"tty_write"
))
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_write"
))
return
-
EIO
;
if
(
!
tty
||
!
tty
->
driver
->
write
||
(
test_bit
(
TTY_IO_ERROR
,
&
tty
->
flags
)))
return
-
EIO
;
...
...
@@ -1059,7 +1059,7 @@ static void release_dev(struct file * filp)
char
buf
[
64
];
tty
=
(
struct
tty_struct
*
)
filp
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
filp
->
f_dentry
->
d_inode
->
i_rdev
,
"release_dev"
))
if
(
tty_paranoia_check
(
tty
,
filp
->
f_dentry
->
d_inode
,
"release_dev"
))
return
;
check_tty_count
(
tty
,
"release_dev"
);
...
...
@@ -1439,7 +1439,7 @@ static unsigned int tty_poll(struct file * filp, poll_table * wait)
struct
tty_struct
*
tty
;
tty
=
(
struct
tty_struct
*
)
filp
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
filp
->
f_dentry
->
d_inode
->
i_rdev
,
"tty_poll"
))
if
(
tty_paranoia_check
(
tty
,
filp
->
f_dentry
->
d_inode
,
"tty_poll"
))
return
0
;
if
(
tty
->
ldisc
.
poll
)
...
...
@@ -1453,7 +1453,7 @@ static int tty_fasync(int fd, struct file * filp, int on)
int
retval
;
tty
=
(
struct
tty_struct
*
)
filp
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
filp
->
f_dentry
->
d_inode
->
i_rdev
,
"tty_fasync"
))
if
(
tty_paranoia_check
(
tty
,
filp
->
f_dentry
->
d_inode
,
"tty_fasync"
))
return
0
;
retval
=
fasync_helper
(
fd
,
filp
,
on
,
&
tty
->
fasync
);
...
...
@@ -1727,7 +1727,7 @@ int tty_ioctl(struct inode * inode, struct file * file,
int
retval
;
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
inode
->
i_rdev
,
"tty_ioctl"
))
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_ioctl"
))
return
-
EINVAL
;
real_tty
=
tty
;
...
...
fs/compat_ioctl.c
View file @
5be694bd
...
...
@@ -1573,7 +1573,7 @@ static int vt_check(struct file *file)
return
-
EINVAL
;
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
inode
->
i_rdev
,
"tty_ioctl"
))
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_ioctl"
))
return
-
EINVAL
;
if
(
tty
->
driver
->
ioctl
!=
vt_ioctl
)
...
...
include/linux/tty.h
View file @
5be694bd
...
...
@@ -367,7 +367,7 @@ extern int espserial_init(void);
extern
int
macserial_init
(
void
);
extern
int
a2232board_init
(
void
);
extern
int
tty_paranoia_check
(
struct
tty_struct
*
tty
,
kdev_t
devic
e
,
extern
int
tty_paranoia_check
(
struct
tty_struct
*
tty
,
struct
inode
*
inod
e
,
const
char
*
routine
);
extern
char
*
tty_name
(
struct
tty_struct
*
tty
,
char
*
buf
);
extern
void
tty_wait_until_sent
(
struct
tty_struct
*
tty
,
long
timeout
);
...
...
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