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
c4a6fedf
Commit
c4a6fedf
authored
Jul 15, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jul 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] 3w-9xxx.c annotated
parent
cd824384
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-9xxx.c
+5
-4
No files found.
drivers/scsi/3w-9xxx.c
View file @
c4a6fedf
...
...
@@ -619,6 +619,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
u32
current_time_ms
;
TW_Device_Extension
*
tw_dev
=
twa_device_extension_list
[
iminor
(
inode
)];
int
retval
=
TW_IOCTL_ERROR_OS_EFAULT
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
/* Only let one of these through at a time */
if
(
down_interruptible
(
&
tw_dev
->
ioctl_sem
))
{
...
...
@@ -627,7 +628,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
}
/* First copy down the driver command */
if
(
copy_from_user
(
&
driver_command
,
(
void
*
)
arg
,
sizeof
(
TW_Ioctl_Driver_Command
)))
if
(
copy_from_user
(
&
driver_command
,
argp
,
sizeof
(
TW_Ioctl_Driver_Command
)))
goto
out2
;
/* Check data buffer size */
...
...
@@ -649,7 +650,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
tw_ioctl
=
(
TW_Ioctl_Buf_Apache
*
)
cpu_addr
;
/* Now copy down the entire ioctl */
if
(
copy_from_user
(
tw_ioctl
,
(
void
*
)
arg
,
driver_command
.
buffer_length
+
sizeof
(
TW_Ioctl_Buf_Apache
)
-
1
))
if
(
copy_from_user
(
tw_ioctl
,
argp
,
driver_command
.
buffer_length
+
sizeof
(
TW_Ioctl_Buf_Apache
)
-
1
))
goto
out3
;
/* See which ioctl we are doing */
...
...
@@ -659,7 +660,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
twa_get_request_id
(
tw_dev
,
&
request_id
);
/* Flag internal command */
tw_dev
->
srb
[
request_id
]
=
0
;
tw_dev
->
srb
[
request_id
]
=
NULL
;
/* Flag chrdev ioctl */
tw_dev
->
chrdev_request_id
=
request_id
;
...
...
@@ -844,7 +845,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
}
/* Now copy the entire response to userspace */
if
(
copy_to_user
(
(
void
*
)
arg
,
tw_ioctl
,
sizeof
(
TW_Ioctl_Buf_Apache
)
+
driver_command
.
buffer_length
-
1
)
==
0
)
if
(
copy_to_user
(
argp
,
tw_ioctl
,
sizeof
(
TW_Ioctl_Buf_Apache
)
+
driver_command
.
buffer_length
-
1
)
==
0
)
retval
=
0
;
out3:
/* Now free ioctl buf memory */
...
...
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