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
cee63f57
Commit
cee63f57
authored
Mar 03, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Mar 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] d_alloc_root() fixes: romfs
- inode leak on d_alloc_root() failure - sanitized the cleanup logics
parent
a828f4fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
fs/romfs/inode.c
fs/romfs/inode.c
+13
-10
No files found.
fs/romfs/inode.c
View file @
cee63f57
...
...
@@ -115,6 +115,7 @@ static int romfs_fill_super(struct super_block *s, void *data, int silent)
{
struct
buffer_head
*
bh
;
struct
romfs_super_block
*
rsb
;
struct
inode
*
root
;
int
sz
;
/* I would parse the options here, but there are none.. :) */
...
...
@@ -154,23 +155,25 @@ static int romfs_fill_super(struct super_block *s, void *data, int silent)
strnlen
(
rsb
->
name
,
ROMFS_MAXFN
)
+
1
+
ROMFH_PAD
)
&
ROMFH_MASK
;
brelse
(
bh
);
s
->
s_op
=
&
romfs_ops
;
root
=
iget
(
s
,
sz
);
if
(
!
root
)
goto
out
;
s
->
s_root
=
d_alloc_root
(
iget
(
s
,
sz
));
if
(
!
s
->
s_root
)
goto
out
nobh
;
goto
out
iput
;
/* Ehrhm; sorry.. :) And thanks to Hans-Joachim Widmaier :) */
if
(
0
)
{
brelse
(
bh
);
return
0
;
outiput:
iput
(
root
);
out:
brelse
(
bh
);
outnobh:
return
-
EINVAL
;
}
return
0
;
}
/* That's simple too. */
...
...
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