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
a567a70e
Commit
a567a70e
authored
Nov 16, 2004
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MTD: Fix memory leak in FTL translation layer.
Signed-off-by:
David Woodhouse
<
dwmw2@infradead.org
>
parent
e613797c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
drivers/mtd/ftl.c
drivers/mtd/ftl.c
+9
-7
No files found.
drivers/mtd/ftl.c
View file @
a567a70e
/* This version ported to the Linux-MTD system by dwmw2@infradead.org
/* This version ported to the Linux-MTD system by dwmw2@infradead.org
* $Id: ftl.c,v 1.5
3 2004/08/09 13:55:43
dwmw2 Exp $
* $Id: ftl.c,v 1.5
4 2004/11/16 18:33:15
dwmw2 Exp $
*
*
* Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups
* - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups
...
@@ -1067,16 +1067,18 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
...
@@ -1067,16 +1067,18 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
partition
->
mbd
.
blksize
=
SECTOR_SIZE
;
partition
->
mbd
.
blksize
=
SECTOR_SIZE
;
partition
->
mbd
.
tr
=
tr
;
partition
->
mbd
.
tr
=
tr
;
partition
->
mbd
.
devnum
=
-
1
;
partition
->
mbd
.
devnum
=
-
1
;
if
(
add_mtd_blktrans_dev
((
void
*
)
partition
))
if
(
!
add_mtd_blktrans_dev
((
void
*
)
partition
))
kfree
(
partition
);
return
;
}
}
else
ftl_freepart
(
partition
);
kfree
(
partition
);
kfree
(
partition
);
}
}
static
void
ftl_remove_dev
(
struct
mtd_blktrans_dev
*
dev
)
static
void
ftl_remove_dev
(
struct
mtd_blktrans_dev
*
dev
)
{
{
del_mtd_blktrans_dev
(
dev
);
del_mtd_blktrans_dev
(
dev
);
ftl_freepart
((
partition_t
*
)
dev
);
kfree
(
dev
);
kfree
(
dev
);
}
}
...
@@ -1094,7 +1096,7 @@ struct mtd_blktrans_ops ftl_tr = {
...
@@ -1094,7 +1096,7 @@ struct mtd_blktrans_ops ftl_tr = {
int
init_ftl
(
void
)
int
init_ftl
(
void
)
{
{
DEBUG
(
0
,
"$Id: ftl.c,v 1.5
3 2004/08/09 13:55:43
dwmw2 Exp $
\n
"
);
DEBUG
(
0
,
"$Id: ftl.c,v 1.5
4 2004/11/16 18:33:15
dwmw2 Exp $
\n
"
);
return
register_mtd_blktrans
(
&
ftl_tr
);
return
register_mtd_blktrans
(
&
ftl_tr
);
}
}
...
...
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