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
8f1d57c1
Commit
8f1d57c1
authored
Jan 02, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amdkfd: don't open-code memdup_user()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
abb0f6a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
26 deletions
+7
-26
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+7
-26
No files found.
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
View file @
8f1d57c1
...
...
@@ -559,19 +559,10 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep,
/* this is the actual buffer to work with */
args_buff
=
kmalloc
(
args
->
buf_size_in_bytes
-
sizeof
(
*
args
),
GFP_KERNEL
);
if
(
args_buff
==
NULL
)
return
-
ENOMEM
;
status
=
copy_from_user
(
args_buff
,
cmd_from_user
,
args_buff
=
memdup_user
(
args_buff
,
args
->
buf_size_in_bytes
-
sizeof
(
*
args
));
if
(
status
!=
0
)
{
pr_debug
(
"Failed to copy address watch user data
\n
"
);
kfree
(
args_buff
);
return
-
EINVAL
;
}
if
(
IS_ERR
(
args_buff
))
return
PTR_ERR
(
args_buff
);
aw_info
.
process
=
p
;
...
...
@@ -677,22 +668,12 @@ static int kfd_ioctl_dbg_wave_control(struct file *filep,
if
(
cmd_from_user
==
NULL
)
return
-
EINVAL
;
/*
this is the actual buffer to work with
*/
/*
copy the entire buffer from user
*/
args_buff
=
kmalloc
(
args
->
buf_size_in_bytes
-
sizeof
(
*
args
),
GFP_KERNEL
);
if
(
args_buff
==
NULL
)
return
-
ENOMEM
;
/* Now copy the entire buffer from user */
status
=
copy_from_user
(
args_buff
,
cmd_from_user
,
args_buff
=
memdup_user
(
cmd_from_user
,
args
->
buf_size_in_bytes
-
sizeof
(
*
args
));
if
(
status
!=
0
)
{
pr_debug
(
"Failed to copy wave control user data
\n
"
);
kfree
(
args_buff
);
return
-
EINVAL
;
}
if
(
IS_ERR
(
args_buff
))
return
PTR_ERR
(
args_buff
);
/* move ptr to the start of the "pay-load" area */
wac_info
.
process
=
p
;
...
...
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