mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-22 06:50:52 +03:00
bcache: Fix null pointer dereferencing
(cherry picked from commit a14f21bf1ddbb93b13a917cad8720fed6c94d6de) Conflicts: lib/device/bcache.c
This commit is contained in:
parent
b90d4b38e5
commit
69907e0780
@ -559,11 +559,13 @@ static bool _init_free_list(struct bcache *cache, unsigned count, unsigned pgsiz
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
cache->raw_data = data;
|
||||
cache->raw_blocks = dm_malloc(count * sizeof(*cache->raw_blocks));
|
||||
|
||||
if (!cache->raw_blocks)
|
||||
dm_free(cache->raw_data);
|
||||
free(data);
|
||||
return false;
|
||||
}
|
||||
|
||||
cache->raw_data = data;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
struct block *b = cache->raw_blocks + i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user