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
f2bdd885
Commit
f2bdd885
authored
Oct 11, 2003
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix jffs2 memory leak on mount error
parent
4a98f95f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
fs/jffs2/scan.c
fs/jffs2/scan.c
+7
-4
No files found.
fs/jffs2/scan.c
View file @
f2bdd885
...
...
@@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
* $Id: scan.c,v 1.10
3 2003/10/07 14:46:23
dwmw2 Exp $
* $Id: scan.c,v 1.10
4 2003/10/11 14:52:48
dwmw2 Exp $
*
*/
#include <linux/kernel.h>
...
...
@@ -116,7 +116,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
ret
=
jffs2_scan_eraseblock
(
c
,
jeb
,
buf_size
?
flashbuf
:
(
flashbuf
+
jeb
->
offset
),
buf_size
);
if
(
ret
<
0
)
return
re
t
;
goto
ou
t
;
ACCT_PARANOIA_CHECK
(
jeb
);
...
...
@@ -240,17 +240,20 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
if
(
!
c
->
used_size
&&
((
empty_blocks
+
bad_blocks
)
!=
c
->
nr_blocks
||
bad_blocks
==
c
->
nr_blocks
)
)
{
printk
(
KERN_NOTICE
"Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
\n
"
);
printk
(
KERN_NOTICE
"empty_blocks %d, bad_blocks %d, c->nr_blocks %d
\n
"
,
empty_blocks
,
bad_blocks
,
c
->
nr_blocks
);
return
-
EIO
;
ret
=
-
EIO
;
goto
out
;
}
jffs2_erase_pending_trigger
(
c
);
}
ret
=
0
;
out:
if
(
buf_size
)
kfree
(
flashbuf
);
#ifndef __ECOS
else
c
->
mtd
->
unpoint
(
c
->
mtd
,
flashbuf
,
0
,
c
->
mtd
->
size
);
#endif
return
0
;
return
ret
;
}
static
int
jffs2_fill_scan_buf
(
struct
jffs2_sb_info
*
c
,
unsigned
char
*
buf
,
...
...
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