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
7c32f3a2
Commit
7c32f3a2
authored
Apr 08, 2003
by
Andrew Morton
Committed by
Linus Torvalds
Apr 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix file leak in fadvise()
It can miss an fput() if passed the fd of a file which has no ->mapping.
parent
ecd0bd4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
mm/fadvise.c
mm/fadvise.c
+5
-2
No files found.
mm/fadvise.c
View file @
7c32f3a2
...
@@ -33,8 +33,10 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
...
@@ -33,8 +33,10 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
inode
=
file
->
f_dentry
->
d_inode
;
inode
=
file
->
f_dentry
->
d_inode
;
mapping
=
inode
->
i_mapping
;
mapping
=
inode
->
i_mapping
;
if
(
!
mapping
)
if
(
!
mapping
)
{
return
-
EINVAL
;
ret
=
-
EINVAL
;
goto
out
;
}
bdi
=
mapping
->
backing_dev_info
;
bdi
=
mapping
->
backing_dev_info
;
...
@@ -69,6 +71,7 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
...
@@ -69,6 +71,7 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
default:
default:
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
}
}
out:
fput
(
file
);
fput
(
file
);
return
ret
;
return
ret
;
}
}
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