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
6560092a
Commit
6560092a
authored
Sep 03, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra tests from get_user_cpu_mask().
They aren't internally consistent.
parent
c3272d7c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
17 deletions
+0
-17
kernel/sched.c
kernel/sched.c
+0
-17
No files found.
kernel/sched.c
View file @
6560092a
...
...
@@ -3366,25 +3366,8 @@ static int get_user_cpu_mask(unsigned long __user *user_mask_ptr, unsigned len,
cpumask_t
*
new_mask
)
{
if
(
len
<
sizeof
(
cpumask_t
))
{
/* Smaller is ok as long as all online CPUs are covered */
int
i
,
max
=
0
;
for_each_online_cpu
(
i
)
max
=
i
;
if
(
len
<
(
max
+
7
)
/
8
)
return
-
EINVAL
;
memset
(
new_mask
,
0
,
sizeof
(
cpumask_t
));
}
else
if
(
len
>
sizeof
(
cpumask_t
))
{
/* Longer is ok as long as all high bits are 0 */
int
i
;
if
(
len
>
PAGE_SIZE
)
return
-
EINVAL
;
for
(
i
=
sizeof
(
cpumask_t
);
i
<
len
;
i
++
)
{
unsigned
char
val
;
if
(
get_user
(
val
,
(
unsigned
char
*
)
user_mask_ptr
+
i
))
return
-
EFAULT
;
if
(
val
)
return
-
EINVAL
;
}
len
=
sizeof
(
cpumask_t
);
}
return
copy_from_user
(
new_mask
,
user_mask_ptr
,
len
)
?
-
EFAULT
:
0
;
...
...
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