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
59287e5e
Commit
59287e5e
authored
Feb 03, 2004
by
Andrew Morton
Committed by
Linus Torvalds
Feb 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] check do_munmap() failure
From: Andrea Arcangeli <andrea@suse.de> Return the proper error code
parent
1ea604a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
mm/mremap.c
mm/mremap.c
+7
-3
No files found.
mm/mremap.c
View file @
59287e5e
...
...
@@ -346,7 +346,9 @@ unsigned long do_mremap(unsigned long addr,
if
((
addr
<=
new_addr
)
&&
(
addr
+
old_len
)
>
new_addr
)
goto
out
;
do_munmap
(
current
->
mm
,
new_addr
,
new_len
);
ret
=
do_munmap
(
current
->
mm
,
new_addr
,
new_len
);
if
(
ret
)
goto
out
;
}
/*
...
...
@@ -354,9 +356,11 @@ unsigned long do_mremap(unsigned long addr,
* the unnecessary pages..
* do_munmap does all the needed commit accounting
*/
ret
=
addr
;
if
(
old_len
>=
new_len
)
{
do_munmap
(
current
->
mm
,
addr
+
new_len
,
old_len
-
new_len
);
ret
=
do_munmap
(
current
->
mm
,
addr
+
new_len
,
old_len
-
new_len
);
if
(
ret
&&
old_len
!=
new_len
)
goto
out
;
ret
=
addr
;
if
(
!
(
flags
&
MREMAP_FIXED
)
||
(
new_addr
==
addr
))
goto
out
;
old_len
=
new_len
;
...
...
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