mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-01 16:57:18 +09:00
dm thin: fix memory leak in process_prepared_mapping error paths
commit 905386f82d upstream.
Fix memory leak in process_prepared_mapping by always freeing
the dm_thin_new_mapping structs from the mapping_pool mempool on
the error paths.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ac9d9e65b6
commit
cd40c442bc
@@ -859,7 +859,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m)
|
||||
|
||||
if (m->err) {
|
||||
cell_error(m->cell);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -871,7 +871,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m)
|
||||
if (r) {
|
||||
DMERR("dm_thin_insert_block() failed");
|
||||
cell_error(m->cell);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -886,6 +886,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m)
|
||||
} else
|
||||
cell_defer(tc, m->cell, m->data_block);
|
||||
|
||||
out:
|
||||
list_del(&m->list);
|
||||
mempool_free(m, tc->pool->mapping_pool);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user