1
0
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:
Marian Csontos 2018-06-26 17:04:18 +02:00
parent b90d4b38e5
commit 69907e0780

View File

@ -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;