[PATCH] vfree and kfree cleanup in drivers/
This patch does a full cleanup of 'NULL checks before vfree', and a partial cleanup of calls to kfree for all of drivers/ - the kfree bit is partial in that I only did the files that also had vfree calls in them. The patch also gets rid of some redundant (void *) casts of pointers being passed to [vk]free, and a some tiny whitespace corrections also crept in. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
887c27f369
commit
f9101210e7
@@ -1017,27 +1017,16 @@ static int ftl_writesect(struct mtd_blktrans_dev *dev,
|
||||
|
||||
void ftl_freepart(partition_t *part)
|
||||
{
|
||||
if (part->VirtualBlockMap) {
|
||||
vfree(part->VirtualBlockMap);
|
||||
part->VirtualBlockMap = NULL;
|
||||
}
|
||||
if (part->VirtualPageMap) {
|
||||
kfree(part->VirtualPageMap);
|
||||
part->VirtualPageMap = NULL;
|
||||
}
|
||||
if (part->EUNInfo) {
|
||||
kfree(part->EUNInfo);
|
||||
part->EUNInfo = NULL;
|
||||
}
|
||||
if (part->XferInfo) {
|
||||
kfree(part->XferInfo);
|
||||
part->XferInfo = NULL;
|
||||
}
|
||||
if (part->bam_cache) {
|
||||
kfree(part->bam_cache);
|
||||
part->bam_cache = NULL;
|
||||
}
|
||||
|
||||
} /* ftl_freepart */
|
||||
|
||||
static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
|
||||
|
Reference in New Issue
Block a user