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
21bb55ac
Commit
21bb55ac
authored
Jul 26, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jul 26, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] drivers/ieee1394 annotation
Signed-off-by:
Linus Torvalds
<
torvalds@osdl.org
>
parent
f51b9905
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
26 deletions
+19
-26
drivers/ieee1394/dv1394.c
drivers/ieee1394/dv1394.c
+2
-2
drivers/ieee1394/raw1394.c
drivers/ieee1394/raw1394.c
+2
-7
drivers/ieee1394/video1394.c
drivers/ieee1394/video1394.c
+14
-16
drivers/ieee1394/video1394.h
drivers/ieee1394/video1394.h
+1
-1
No files found.
drivers/ieee1394/dv1394.c
View file @
21bb55ac
...
...
@@ -2518,7 +2518,7 @@ static int handle_dv1394_init(unsigned int fd, unsigned int cmd, unsigned long a
if
(
file
->
f_op
->
ioctl
!=
dv1394_ioctl
)
return
-
EFAULT
;
if
(
copy_from_user
(
&
dv32
,
(
void
*
)
arg
,
sizeof
(
dv32
)))
if
(
copy_from_user
(
&
dv32
,
(
void
__user
*
)
arg
,
sizeof
(
dv32
)))
return
-
EFAULT
;
dv
.
api_version
=
dv32
.
api_version
;
...
...
@@ -2568,7 +2568,7 @@ static int handle_dv1394_get_status(unsigned int fd, unsigned int cmd, unsigned
dv32
.
n_clear_frames
=
dv
.
n_clear_frames
;
dv32
.
dropped_frames
=
dv
.
dropped_frames
;
if
(
copy_to_user
((
struct
dv1394_status32
*
)
arg
,
&
dv32
,
sizeof
(
dv32
)))
if
(
copy_to_user
((
struct
dv1394_status32
__user
*
)
arg
,
&
dv32
,
sizeof
(
dv32
)))
ret
=
-
EFAULT
;
}
...
...
drivers/ieee1394/raw1394.c
View file @
21bb55ac
...
...
@@ -55,13 +55,8 @@
#include "raw1394.h"
#include "raw1394-private.h"
#if BITS_PER_LONG == 64
#define int2ptr(x) ((void __user *)x)
#define int2ptr(x) ((void __user *)(unsigned long)x)
#define ptr2int(x) ((u64)(unsigned long)(void __user *)x)
#else
#define int2ptr(x) ((void __user *)(u32)x)
#define ptr2int(x) ((u64)(unsigned long)(void __user *)x)
#endif
#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
#define RAW1394_DEBUG
...
...
@@ -1629,7 +1624,7 @@ static int arm_register(struct file_info *fi, struct pending_request *req)
if
(
another_host
)
{
DBGMSG
(
"another hosts entry is valid -> SUCCESS"
);
if
(
copy_to_user
(
int2ptr
(
req
->
req
.
recvb
),
int2ptr
(
&
addr
->
start
)
,
sizeof
(
u64
)))
{
&
addr
->
start
,
sizeof
(
u64
)))
{
printk
(
KERN_ERR
"raw1394: arm_register failed "
" address-range-entry is invalid -> EFAULT !!!
\n
"
);
vfree
(
addr
->
addr_space_buffer
);
...
...
drivers/ieee1394/video1394.c
View file @
21bb55ac
...
...
@@ -1003,11 +1003,9 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
case
VIDEO1394_IOC_TALK_QUEUE_BUFFER
:
{
struct
video1394_wait
v
;
struct
video1394_queue_variable
qv
;
unsigned
int
*
psizes
=
NULL
;
struct
dma_iso_ctx
*
d
;
qv
.
packet_sizes
=
NULL
;
if
(
copy_from_user
(
&
v
,
argp
,
sizeof
(
v
)))
return
-
EFAULT
;
...
...
@@ -1021,22 +1019,21 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
}
if
(
d
->
flags
&
VIDEO1394_VARIABLE_PACKET_SIZE
)
{
unsigned
int
*
psizes
;
int
buf_size
=
d
->
nb_cmd
*
sizeof
(
unsigned
int
);
struct
video1394_queue_variable
__user
*
p
=
argp
;
unsigned
int
__user
*
qv
;
if
(
copy_from_user
(
&
qv
,
argp
,
sizeof
(
qv
)
))
if
(
get_user
(
qv
,
&
p
->
packet_sizes
))
return
-
EFAULT
;
psizes
=
kmalloc
(
buf_size
,
GFP_KERNEL
);
if
(
!
psizes
)
return
-
ENOMEM
;
if
(
copy_from_user
(
psizes
,
qv
.
packet_sizes
,
buf_size
))
{
if
(
copy_from_user
(
psizes
,
qv
,
buf_size
))
{
kfree
(
psizes
);
return
-
EFAULT
;
}
qv
.
packet_sizes
=
psizes
;
}
spin_lock_irqsave
(
&
d
->
lock
,
flags
);
...
...
@@ -1045,14 +1042,14 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
PRINT
(
KERN_ERR
,
ohci
->
host
->
id
,
"Buffer %d is already used"
,
v
.
buffer
);
spin_unlock_irqrestore
(
&
d
->
lock
,
flags
);
if
(
qv
.
packet_
sizes
)
kfree
(
qv
.
packet_
sizes
);
if
(
p
sizes
)
kfree
(
p
sizes
);
return
-
EFAULT
;
}
if
(
d
->
flags
&
VIDEO1394_VARIABLE_PACKET_SIZE
)
{
initialize_dma_it_prg_var_packet_queue
(
d
,
v
.
buffer
,
qv
.
packet_
sizes
,
d
,
v
.
buffer
,
p
sizes
,
ohci
);
}
...
...
@@ -1101,8 +1098,8 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
}
}
if
(
qv
.
packet_
sizes
)
kfree
(
qv
.
packet_
sizes
);
if
(
p
sizes
)
kfree
(
p
sizes
);
return
0
;
...
...
@@ -1339,6 +1336,7 @@ struct video1394_wait32 {
static
int
video1394_wr_wait32
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
,
struct
file
*
file
)
{
struct
video1394_wait32
__user
*
argp
=
(
void
__user
*
)
arg
;
struct
video1394_wait32
wait32
;
struct
video1394_wait
wait
;
mm_segment_t
old_fs
;
...
...
@@ -1347,7 +1345,7 @@ static int video1394_wr_wait32(unsigned int fd, unsigned int cmd, unsigned long
if
(
file
->
f_op
->
ioctl
!=
video1394_ioctl
)
return
-
EFAULT
;
if
(
copy_from_user
(
&
wait32
,
(
void
*
)
arg
,
sizeof
(
wait32
)))
if
(
copy_from_user
(
&
wait32
,
argp
,
sizeof
(
wait32
)))
return
-
EFAULT
;
wait
.
channel
=
wait32
.
channel
;
...
...
@@ -1373,7 +1371,7 @@ static int video1394_wr_wait32(unsigned int fd, unsigned int cmd, unsigned long
wait32
.
filltime
.
tv_sec
=
(
int
)
wait
.
filltime
.
tv_sec
;
wait32
.
filltime
.
tv_usec
=
(
int
)
wait
.
filltime
.
tv_usec
;
if
(
copy_to_user
(
(
struct
video1394_wait32
*
)
arg
,
&
wait32
,
sizeof
(
wait32
)))
if
(
copy_to_user
(
argp
,
&
wait32
,
sizeof
(
wait32
)))
ret
=
-
EFAULT
;
}
...
...
@@ -1391,7 +1389,7 @@ static int video1394_w_wait32(unsigned int fd, unsigned int cmd, unsigned long a
if
(
file
->
f_op
->
ioctl
!=
video1394_ioctl
)
return
-
EFAULT
;
if
(
copy_from_user
(
&
wait32
,
(
void
*
)
arg
,
sizeof
(
wait32
)))
if
(
copy_from_user
(
&
wait32
,
(
void
__user
*
)
arg
,
sizeof
(
wait32
)))
return
-
EFAULT
;
wait
.
channel
=
wait32
.
channel
;
...
...
drivers/ieee1394/video1394.h
View file @
21bb55ac
...
...
@@ -53,7 +53,7 @@ struct video1394_mmap {
struct
video1394_queue_variable
{
unsigned
int
channel
;
unsigned
int
buffer
;
unsigned
int
*
packet_sizes
;
/* Buffer of size:
unsigned
int
__user
*
packet_sizes
;
/* Buffer of size:
buf_size / packet_size */
};
...
...
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